Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #8324 -- Corrected the simple case where list_display is not gi…

…ven. Thanks tobias for the quick report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8353 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit dd0e5fd992986211bdb52b2cdfbd1e232788a20b 1 parent b2ec647
@brosner brosner authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 django/contrib/admin/templatetags/admin_list.py
View
6 django/contrib/admin/templatetags/admin_list.py
@@ -70,8 +70,9 @@ def pagination(cl):
def result_headers(cl):
lookup_opts = cl.lookup_opts
-
+
for i, field_name in enumerate(cl.list_display):
+ attr = None
try:
f = lookup_opts.get_field(field_name)
admin_order_field = None
@@ -150,7 +151,8 @@ def items_for_result(cl, result):
if callable(field_name):
attr = field_name
value = attr(result)
- elif hasattr(cl.model_admin, field_name):
+ elif hasattr(cl.model_admin, field_name) and \
+ not field_name == '__str__' and not field_name == '__unicode__':
attr = getattr(cl.model_admin, field_name)
value = attr(result)
else:
Please sign in to comment.
Something went wrong with that request. Please try again.