[Django] #36926: Admin list_display does not use boolean icons when traversing properties

2 views
Skip to first unread message

Django

unread,
Feb 13, 2026, 4:27:54 PM (6 days ago) Feb 13
to django-...@googlegroups.com
#36926: Admin list_display does not use boolean icons when traversing properties
--------------------------------+-----------------------------------------
Reporter: Michael Nagler | Type: Uncategorized
Status: new | Component: contrib.admin
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+-----------------------------------------
I have a UserProfile model that I am attempting to inline into the User
admin page.

I want to show an additional column in the User admin denoting the value
of UserProfile.verified. I can successfully add this column by appending
{{{'profile__verified'}}} the list_display property of my custom UserAdmin
class, however the value that shows up in the column is either the string
{{{"True"}}} or {{{"False"}}}.

It would be great if adding {{{'profile__verified'}}} to the list_display
of the admin class could detect that the field is a boolean (it is indeed
an instance of {{{models.BooleanField}}} on the {{{UserProfile}}}), and
display the icons.

My current workaround is to define a callable on my custom admin class and
mark it as a boolean with the {{{admin.display}}} decorator.

For reference, here is the model and admin class that produce the
undesirable behavior:

{{{
class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE,
related_name='profile')
verified = models.BooleanField(default=False)


@admin.register(User)
class UserAdmin(BaseUserAdmin):
inlines = [UserProfileInline]
list_select_related = ['profile']

list_display = list(BaseUserAdmin.list_display) +
['profile__verified']
list_filter = list(BaseUserAdmin.list_filter) + ['profile__verified']
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36926>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 16, 2026, 3:29:29 PM (3 days ago) Feb 16
to django-...@googlegroups.com
#36926: Admin list_display does not use boolean icons when traversing properties
-------------------------------------+-------------------------------------
Reporter: Michael Nagler | Owner: Huwaiza
Type: Uncategorized | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Huwaiza):

* cc: Huwaiza (added)
* owner: (none) => Huwaiza
* stage: Unreviewed => Ready for checkin
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36926#comment:1>

Django

unread,
Feb 16, 2026, 3:30:24 PM (3 days ago) Feb 16
to django-...@googlegroups.com
#36926: Admin list_display does not use boolean icons when traversing properties
-------------------------------------+-------------------------------------
Reporter: Michael Nagler | Owner: Huwaiza
Type: New feature | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Huwaiza):

* type: Uncategorized => New feature

--
Ticket URL: <https://code.djangoproject.com/ticket/36926#comment:2>

Django

unread,
Feb 16, 2026, 4:12:58 PM (3 days ago) Feb 16
to django-...@googlegroups.com
#36926: Admin list_display does not use boolean icons when traversing properties
-------------------------------------+-------------------------------------
Reporter: Michael Nagler | Owner: Huwaiza
Type: New feature | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Huwaiza):

* has_patch: 0 => 1
* ui_ux: 0 => 1

Comment:

PR link: https://github.com/django/django/pull/20718
--
Ticket URL: <https://code.djangoproject.com/ticket/36926#comment:3>

Django

unread,
Feb 17, 2026, 7:36:05 PM (2 days ago) Feb 17
to django-...@googlegroups.com
#36926: Admin list_display does not use boolean icons when traversing properties
--------------------------------+--------------------------------------
Reporter: Michael Nagler | Owner: Huwaiza
Type: New feature | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------+--------------------------------------
Changes (by Antoliny):

* stage: Ready for checkin => Unreviewed

--
Ticket URL: <https://code.djangoproject.com/ticket/36926#comment:4>

Django

unread,
Feb 18, 2026, 8:14:01 AM (yesterday) Feb 18
to django-...@googlegroups.com
#36926: Admin list_display does not use boolean icons when traversing properties
--------------------------------+--------------------------------------
Reporter: Michael Nagler | Owner: Huwaiza
Type: New feature | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------+--------------------------------------
Comment (by Antoliny):

Thank you for the suggestion Huwaiza!
Correct me if I'm wrong, but are you saying that when a field is a
`BooleanField`, it should automatically be displayed as an icon without
needing to use `admin.display(boolean=True)`?
Are there any cases where displaying it as plain text would be useful?
--
Ticket URL: <https://code.djangoproject.com/ticket/36926#comment:5>

Django

unread,
Feb 18, 2026, 2:06:45 PM (21 hours ago) Feb 18
to django-...@googlegroups.com
#36926: Admin list_display does not use boolean icons when traversing properties
--------------------------------+--------------------------------------
Reporter: Michael Nagler | Owner: Huwaiza
Type: New feature | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------+--------------------------------------
Comment (by Huwaiza):

Yes, that is exactly right. When a field is a direct BooleanField on the
model for example
{{{
list_display = ['is_active']
}}}
Django already automatically displays it as a boolean icon, no
@admin.display(boolean=True) needed.

This is handled in display_for_field() in django/contrib/admin/utils.py:

{{{
elif isinstance(field, models.BooleanField):
return _boolean_icon(value)
}}}


The bug is specifically about **related field traversal**. When you write
'profile__verified' instead of 'verified', Django cannot find the field
via _get_non_gfk_field() because the name contains '__', so it falls back
to f=None. With f=None, it calls display_for_value() instead of
display_for_field(), which simply returns str(value) → "True"/"False".

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.

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.
--
Ticket URL: <https://code.djangoproject.com/ticket/36926#comment:6>

Django

unread,
12:58 AM (10 hours ago) 12:58 AM
to django-...@googlegroups.com
#36926: Admin list_display does not use boolean icons when traversing properties
--------------------------------+--------------------------------------
Reporter: Michael Nagler | Owner: Huwaiza
Type: New feature | Status: assigned
Component: contrib.admin | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
--------------------------------+--------------------------------------
Changes (by Brian Helba):

* cc: Brian Helba (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/36926#comment:7>
Reply all
Reply to author
Forward
0 new messages