Opened 17 years ago
Last modified 5 years ago
#6933 closed
You cannot search with spaces if search_fields is declared with "^" — at Initial Version
Description ¶
That is. When search_fields is declared to "starts with" you cannot perform queries with spaces.
File contrib/admin/views/main.py; Line 326:
for bit in self.query.split(): or_queries = [models.Q(**{construct_search(field_name): bit}) for field_name in self.search_fields] other_qs = QuerySet(self.model) (...) qs = qs & other_qs
So, if for example i'm looking for "Hey dud" query will be:
qs.filter(fieldstartswith="Hey") & qs.filter(fieldstartswith("dud"))
Note:
See TracTickets
for help on using tickets.