#8398 closed (worksforme)
Admin lists aren't showing non-field columns in table header
Reported by: | Marinho Brandão | Owned by: | Manuel Saelices |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When declared a method in list_display attribute of a ModelAdmin class, this column header (TH) is shown in result list of change_list_result.html with an error and this make it hidden, as follows:
<th<font color='red'>header.class_attrib</font>>
this line must have an {% if %} consistence around header.class_attrib:
{% for header in result_headers %}<th{{ header.class_attrib }}>
Attachments (1)
Change History (9)
by , 16 years ago
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 16 years ago
Has patch: | set |
---|
comment:3 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 16 years ago
comment:5 by , 16 years ago
I cannot reproduce the error either.
There should be no error because of the way invalid variables are handled. An if
statement is unnecessary.
comment:6 by , 16 years ago
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
comment:7 by , 16 years ago
I just had a similar problem and pinpointed the cause to TEMPLATE_STRING_IF_INVALID. So if you're experiencing a similar problem you should check whether you have TEMPLATE_STRING_IF_INVALID set in your settings.py. (Not a bug since the docs warn that the admin interface expects the setting to be left alone)
@marinho, I can't reproduce the error. All works fine. Can you give me both
models.py
andadmin.py
, please?I've used this
models.py
andadmin.py
: