Skip to content

Commit

Permalink
Removed some checks for Model._meta.one_to_one_field to prevent list_…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
brosner committed Aug 15, 2008
1 parent c0d862d commit 417a4d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django/contrib/admin/templatetags/admin_list.py
Expand Up @@ -302,7 +302,7 @@ def date_hierarchy(cl):
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)
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admin/views/main.py
Expand Up @@ -68,7 +68,7 @@ def __init__(self, request, model, list_display, list_display_links, list_filter

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)
Expand Down

0 comments on commit 417a4d6

Please sign in to comment.