Ticket #6933: django-6933-0.2.diff
File django-6933-0.2.diff, 957 bytes (added by , 16 years ago) |
---|
-
main.py
731 731 else: 732 732 return "%s__icontains" % field_name 733 733 734 if self.lookup_opts.admin.search_fields and self.query: 735 for bit in self.query.split(): 734 def query_split(query): 735 first_bits = query.split('"') 736 result_bits = first_bits[1::2] 737 for bit in first_bits[0::2]: 738 result_bits.extend( bit.split() ) 739 return result_bits 740 741 if self.lookup_opts.admin.search_fields and self.query: 742 for bit in query_split(self.query): 736 743 or_queries = [models.Q(**{construct_search(field_name): bit}) for field_name in self.lookup_opts.admin.search_fields] 737 744 other_qs = QuerySet(self.model) 738 745 other_qs.dup_select_related(qs)