Ticket #5970: django_admin_search_bug.patch

File django_admin_search_bug.patch, 770 bytes (added by Nazar <911.17@…>, 17 years ago)
  • django/contrib/admin/views/main.py

     
    753753        if self.lookup_opts.admin.search_fields and self.query:
    754754            for bit in self.query.split():
    755755                or_queries = [models.Q(**{construct_search(field_name): bit}) for field_name in self.lookup_opts.admin.search_fields]
    756                 other_qs = QuerySet(self.model)
     756                other_qs = self.manager.get_query_set()
    757757                if qs._select_related:
    758758                    other_qs = other_qs.select_related()
    759759                other_qs = other_qs.filter(reduce(operator.or_, or_queries))
Back to Top