Ticket #9969: t9969-r9701.diff
File t9969-r9701.diff, 1.3 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/templatetags/admin_list.py
70 70 71 71 def result_headers(cl): 72 72 lookup_opts = cl.lookup_opts 73 73 74 74 for i, field_name in enumerate(cl.list_display): 75 75 attr = None 76 76 try: … … 97 97 raise AttributeError, \ 98 98 "'%s' model or '%s' objects have no attribute '%s'" % \ 99 99 (lookup_opts.object_name, cl.model_admin.__class__, field_name) 100 100 101 101 try: 102 102 header = attr.short_description 103 103 except AttributeError: … … 205 205 result_repr = EMPTY_CHANGELIST_VALUE 206 206 # Fields with choices are special: Use the representation 207 207 # of the choice. 208 elif f. choices:209 result_repr = dict(f. choices).get(field_val, EMPTY_CHANGELIST_VALUE)208 elif f.flatchoices: 209 result_repr = dict(f.flatchoices).get(field_val, EMPTY_CHANGELIST_VALUE) 210 210 else: 211 211 result_repr = escape(field_val) 212 212 if force_unicode(result_repr) == '':