Changes between Version 1 and Version 2 of Ticket #36926, comment 6


Ignore:
Timestamp:
Feb 23, 2026, 12:26:03 PM (11 days ago)
Author:
Natalia Bidart

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36926, comment 6

    v1 v2  
    11Yes, that is exactly right. When a field is a direct BooleanField on the model for example
    2 {{{#!python
     2{{{
    33list_display = ['is_active']
    44}}}
     
    77This is handled in display_for_field() in django/contrib/admin/utils.py:
    88
    9 {{{#!python
     9{{{
    1010elif isinstance(field, models.BooleanField):
    1111     return _boolean_icon(value)
     
    1717This 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.
    1818
    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.
     19Regarding 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.
Back to Top