intranet.apps.search package

Submodules

intranet.apps.search.tests module

class intranet.apps.search.tests.SearchTestCase(methodName='runTest')[source]

Bases: IonTestCase

test_search_grad_year()[source]

Tests searching by a student ID.

Tests searching by a user’s name.

intranet.apps.search.urls module

intranet.apps.search.utils module

intranet.apps.search.utils.get_query(query_string, search_fields)[source]

Returns a query, that is a combination of Q objects.

That combination aims to search keywords within a model by testing the given search fields.

intranet.apps.search.utils.normalize_query(query_string, findterms=<built-in method findall of re.Pattern object>, normspace=<built-in method sub of re.Pattern object>)[source]

Splits the query string in individual keywords, getting rid of unnecessary spaces and grouping quoted words together. Example:

>>> normalize_query('  some random  words "with   quotes  " and   spaces')
['some', 'random', 'words', 'with quotes', 'and', 'spaces']

intranet.apps.search.views module

Search for announcements.

Returns:

A tuple of the announcements and club announcements

intranet.apps.search.views.get_search_results(q, admin=False)[source]
intranet.apps.search.views.query(q, admin=False)[source]

Module contents