Changes between Initial Version and Version 1 of Ticket #11195, comment 6
- Timestamp:
- Apr 22, 2011, 7:32:29 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #11195, comment 6
initial v1 4 4 5 5 {{{ 6 list_column_classes = getattr(cl.model_admin, 'list_column_classes' ) or {}6 list_column_classes = getattr(cl.model_admin, 'list_column_classes', {}) 7 7 8 8 for field_name in cl.list_display: 9 9 # .... 10 10 11 column_class = list_column_classes.get(field_name) 12 if column_class: 13 row_classes.append(column_class) 11 row_classes.append(list_column_classes.get(field_name, 'col-' + field_name)) 14 12 }}} 15 13 16 * This allows the developers to define a `list_column_classes` attribute on a `ModelAdmin` 17 * Only the rows that really need a class have to included. 14 This also allows the developers to define a `list_column_classes` attribute on a `ModelAdmin` 18 15 19 16 Getting the HTML size trimmed down is one thing. 20 17 Having an admin list with badly formatted column widths is far worse for clients. 18 I'd really like to see something like this by default in Django, to stop DRY implementations.