diff -r 9f23205f00f4 django/contrib/admin/views/main.py
a
|
b
|
|
239 | 239 | return "%s__icontains" % field_name |
240 | 240 | |
241 | 241 | if self.search_fields and self.query: |
242 | | for bit in self.query.split(): |
243 | | or_queries = [models.Q(**{construct_search(str(field_name)): bit}) for field_name in self.search_fields] |
244 | | qs = qs.filter(reduce(operator.or_, or_queries)) |
| 242 | qs = qs.filter(*[reduce(operator.or_, [models.Q(**{construct_search(str(field_name)): bit}) |
| 243 | for field_name in self.search_fields]) |
| 244 | for bit in self.query.split()]) |
245 | 245 | for field_name in self.search_fields: |
246 | 246 | if '__' in field_name: |
247 | 247 | qs = qs.distinct() |