From 417a4d66df25510afc20243678358c52d77287f7 Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Fri, 15 Aug 2008 19:15:20 +0000 Subject: [PATCH] Removed some checks for Model._meta.one_to_one_field to prevent list_filter and the show_result_count in search_form.html. Fixes #2145. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8388 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/templatetags/admin_list.py | 2 +- django/contrib/admin/views/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py index 69b27be829..cae33cc20e 100644 --- a/django/contrib/admin/templatetags/admin_list.py +++ b/django/contrib/admin/templatetags/admin_list.py @@ -302,7 +302,7 @@ date_hierarchy = register.inclusion_tag('admin/date_hierarchy.html')(date_hierar def search_form(cl): return { 'cl': cl, - 'show_result_count': cl.result_count != cl.full_result_count and not cl.opts.one_to_one_field, + 'show_result_count': cl.result_count != cl.full_result_count, 'search_var': SEARCH_VAR } search_form = register.inclusion_tag('admin/search_form.html')(search_form) diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 116d9d49f1..50b015352d 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -68,7 +68,7 @@ class ChangeList(object): def get_filters(self, request): filter_specs = [] - if self.list_filter and not self.opts.one_to_one_field: + if self.list_filter: filter_fields = [self.lookup_opts.get_field(field_name) for field_name in self.list_filter] for f in filter_fields: spec = FilterSpec.create(f, request, self.params, self.model, self.model_admin)