diff --git a/AUTHORS b/AUTHORS index 0f80baf81a..423c44fd3c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -72,6 +72,7 @@ answer newbie questions, and generally made Django that much better: Jeremy Dunck Andy Dustman Clint Ecker + favo@exoweb.net gandalf@owca.info Baishampayan Ghose martin.glueck@gmail.com diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 7c942ca5b8..38d64bd73b 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -727,6 +727,8 @@ class ChangeList(object): for bit in self.query.split(): or_queries = [models.Q(**{construct_search(field_name): bit}) for field_name in self.lookup_opts.admin.search_fields] other_qs = QuerySet(self.model) + if qs._select_related: + other_qs = other_qs.select_related() other_qs = other_qs.filter(reduce(operator.or_, or_queries)) qs = qs & other_qs