1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Added AllValuesFilterSpec to admin changelist filters, which lets you put any arbitrary field in Admin.list_filter. To determine the list of all available choices, Django does a SELECT DISTINCT. Note this is backwards-incompatible for people who have defined and registered their own FilterSpecs, because each FilterSpec now takes a 'model' parameter.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3136 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2006-06-16 19:42:06 +00:00
parent 72307a6eee
commit d599052a15
2 changed files with 42 additions and 19 deletions

View File

@@ -574,7 +574,7 @@ class ChangeList(object):
filter_fields = [self.lookup_opts.get_field(field_name) \
for field_name in self.lookup_opts.admin.list_filter]
for f in filter_fields:
spec = FilterSpec.create(f, request, self.params)
spec = FilterSpec.create(f, request, self.params, self.model)
if spec and spec.has_output():
filter_specs.append(spec)
return filter_specs, bool(filter_specs)