#24316: Admin changelist column CSS classes do not use short description, 
instead
using str(list_display_function)
-------------------------------+--------------------
     Reporter:  JordanBright   |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Uncategorized  |    Version:  1.7
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 The column names in a changelist respect the short description but the CSS
 classes do not. This is particularly bad if you use a lambda as the class
 name becomes `column-< ;function <lambda> at ...` in the `th` and
 `field-<function <lambda> at ...` in the `td`.

 I think this is caused by two functions in
 `django/contrib/admin/templatetags/admin_list.py`

 `result_headers` uses `field_name` from `for i, field_name in
 enumerate(cl.list_display)` when it should be using `text` (from `text,
 attr = label_for_field(...)`) and doing something to make it a safe css
 class name, I think

 `items_for_result` also uses `field_name` from `for field_name in
 cl.list_display` and it should probably just use whatever `result_headers`
 should be using.

 To reproduce simply create a lambda function and put it in a list display
 then inspect the header and field classes in your browser. I'll attach a
 test case that reproduces it shortly.

--
Ticket URL: <https://code.djangoproject.com/ticket/24316>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/055.934e12e42bda54740a38d61d7855eca4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to