Opened 46 minutes ago
Last modified 2 minutes ago
#37332 assigned Bug
Admin `list_display` does not show icon for generated boolean fields
| Reported by: | Marijke Luttekes | Owned by: | Yassin Bahri |
|---|---|---|---|
| Component: | contrib.admin | Version: | 6.1 |
| Severity: | Normal | Keywords: | admin |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | yes |
Description
Per the Django 6.1 release notes:
list_displaynow uses boolean icons for boolean fields on related models.
This does not work for instances of GeneratedField with output_field=models.BooleanField(), like so:
from django.db import models
is_done = models.GeneratedField(
# Redacted for brevity
output_field=models.BooleanField(),
db_persist=True,
)
Both fields in admin list display and filter (list_display and list_filter, respectively) show the output of these fields as True or False.
NB. The code I used for this is currently on a feature branch that's actively being pushed over: https://github.com/MHLut/django-local-test/tree/feature/todo.
Attachments (1)
Change History (3)
by , 46 minutes ago
| Attachment: | Screenshot 2026-09-08 at 16.39.05.png added |
|---|
comment:1 by , 2 minutes ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 2 minutes ago
| Has patch: | set |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
I can reproduce this on Django 6.1.
Create a model with a generated boolean field:
class Item(models.Model): value = models.BooleanField(default=False) is_done = models.GeneratedField( expression=models.F("value"), output_field=models.BooleanField(), db_persist=True, )Add the field to an admin changelist:
@admin.register(Item) class ItemAdmin(admin.ModelAdmin): list_display = ("is_done",)After creating one object with
value=Trueand another withvalue=False, the changelist displays the literal textTrueandFalse.Regular
BooleanFieldvalues are rendered with Django’s boolean icons (icon-yes.svgandicon-no.svg), so generated boolean fields should behave consistently.