Changes between Version 1 and Version 2 of Ticket #36926, comment 6
- Timestamp:
- Feb 23, 2026, 12:26:03 PM (11 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36926, comment 6
v1 v2 1 1 Yes, that is exactly right. When a field is a direct BooleanField on the model for example 2 {{{ #!python2 {{{ 3 3 list_display = ['is_active'] 4 4 }}} … … 7 7 This is handled in display_for_field() in django/contrib/admin/utils.py: 8 8 9 {{{ #!python9 {{{ 10 10 elif isinstance(field, models.BooleanField): 11 11 return _boolean_icon(value) … … 17 17 This fix closes that gap: when traversing a relation path with `__`, we resolve the final field using `get_fields_from_path()` and pass it as `f`, so `display_for_field()` is called correctly and the same automatic boolean icon behavior that exists for direct fields is preserved. 18 18 19 Regarding your question about plain text being useful, No, there is no case where a `BooleanField` should display as plain text in the changelist. Django already makes this decision unconditionally for direct `BooleanField`s, the fix simply extends that same existing behavior to related field traversal for consistency.19 Regarding your question about plain text being useful, No, there is no case where a BooleanField should display as plain text in the changelist. Django already makes this decision unconditionally for direct BooleanFields, the fix simply extends that same existing behavior to related field traversal for consistency.