Opened 15 years ago

Closed 15 years ago

#12136 closed (duplicate)

Minor visual problem in django admin (and correction)

Reported by: deltoide Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords: admin contrib
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When I use callables in the 'list_display' property of the Admin class, the header columns (names of those properties) are not displayed correctly (see screenshot here: http://bit.ly/1bVz1R).
After investigating a little I found that it was because a missing property (class_attrib) of the header object:

This correction works for me (file: admin_list.py in django/contrib/admin/templatetags/, line 116):

            # It is a non-field, but perhaps one that is sortable
            admin_order_field = getattr(attr, "admin_order_field", None)
            if not admin_order_field:
                yield {"text": header,
                       "class_attrib": "", # line added
                       }
                continue

Change History (2)

comment:1 by deltoide, 15 years ago

Small precision: the problem is only there if TEMPLATE_STRING_IF_INVALID is set to something other than .

in reply to:  1 comment:2 by Karen Tracey, 15 years ago

Resolution: duplicate
Status: newclosed

Replying to deloide:

Small precision: the problem is only there if TEMPLATE_STRING_IF_INVALID is set to something other than .

Then it's a dupe of #3579.

Note: See TracTickets for help on using tickets.
Back to Top