summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/filterspecs.py2
-rw-r--r--django/contrib/admin/templatetags/admin_list.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/django/contrib/admin/filterspecs.py b/django/contrib/admin/filterspecs.py
index fd258df6b7..6f643ee102 100644
--- a/django/contrib/admin/filterspecs.py
+++ b/django/contrib/admin/filterspecs.py
@@ -90,7 +90,7 @@ class ChoicesFilterSpec(FilterSpec):
yield {'selected': self.lookup_val is None,
'query_string': cl.get_query_string({}, [self.lookup_kwarg]),
'display': _('All')}
- for k, v in self.field.choices:
+ for k, v in self.field.flatchoices:
yield {'selected': smart_unicode(k) == self.lookup_val,
'query_string': cl.get_query_string({self.lookup_kwarg: k}),
'display': v}
diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py
index 21401caf43..d97c36a207 100644
--- a/django/contrib/admin/templatetags/admin_list.py
+++ b/django/contrib/admin/templatetags/admin_list.py
@@ -205,8 +205,8 @@ def items_for_result(cl, result, form):
result_repr = EMPTY_CHANGELIST_VALUE
# Fields with choices are special: Use the representation
# of the choice.
- elif f.choices:
- result_repr = dict(f.choices).get(field_val, EMPTY_CHANGELIST_VALUE)
+ elif f.flatchoices:
+ result_repr = dict(f.flatchoices).get(field_val, EMPTY_CHANGELIST_VALUE)
else:
result_repr = escape(field_val)
if force_unicode(result_repr) == '':