intranet.apps.search package¶
Submodules¶
intranet.apps.search.tests module¶
- class intranet.apps.search.tests.SearchTestCase(methodName='runTest')[source]¶
Bases:
IonTestCase
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¶
- intranet.apps.search.views.do_announcements_search(q, user) tuple[list[Announcement], list[Announcement]] [source]¶
Search for announcements.
- Returns:
A tuple of the announcements and club announcements