Add column-<field_name> classes to the admin list

This simplifies CSS styling to set column widths.
This commit is contained in:
Diederik van der Boor 2013-02-24 17:31:26 +01:00
parent 8503120c10
commit b7ba4fc408
3 changed files with 13 additions and 3 deletions

View file

@ -543,6 +543,13 @@ subclass::
The above will tell Django to order by the ``first_name`` field when
trying to sort by ``colored_first_name`` in the admin.
* .. versionadded:: 1.6
The field names in ``list_display`` will also appear as CSS classes in
the HTML output, in the form of ``column-<field_name>`` on each ``<th>``
element. This can be used to set column widths in a CSS file for example.
.. attribute:: ModelAdmin.list_display_links
Set ``list_display_links`` to control which fields in ``list_display``