On Django 1.2, I'm getting a missing template variable when using a
custom formatter in the django admin.
Here is my admin class:
class CustomerAdmin(admin.ModelAdmin):
fields = [
'name',
]
list_display = [
'name',
'customer_tenants',
]
def customer_tenants(self, customer):
return u', '.join(t.subdomain for t in
customer.tenant_set.all())
customer_tenants.short_description = 'Tenants'
The error seems to be the same one as in this ticket:
http://code.djangoproject.com/ticket/2583
Looking at the template from the admin app, the header.class_attrib
seems to be missing. This is generated internally by django.
I can fix the error by changing the template admin/
change_list_results.html by putting an if statement around the
{{ header.class_attrib }} variable:
{% for header in result_headers %}<th{% if header.class_attrib %}
{{ header.class_attrib }}{% endif %}>
Is this an error due to improper configuration or due to a bug in
django?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.