I really hope that I'm not missing anything.
I have a model with a boolean property I'd like to show in my admin list
view:
{{{
class MyModel(models.Model):
....
@property
@admin.display(description=_('Is external'), boolean=True)
def is_external(self):
return bool(self.requested_external)
}}}
My admin column shows True and False strings instead of the green and red
icons.
When I remove the property decorator, it works as expected.
I double-checked the docs but couldn't find any note about not using it
with properties.
Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/32792>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "admin_column.png" added.
* cc: Nick Pope (added)
* status: new => closed
* resolution: => duplicate
Comment:
Yes, `boolean` doesn't work for properties. It's a duplicate of #31558.
--
Ticket URL: <https://code.djangoproject.com/ticket/32792#comment:1>
Comment (by Ron):
Ok, I searched the database for django 3.2 issues (because the decorator
was added there - thats why I didnt find it. Sorry.
--
Ticket URL: <https://code.djangoproject.com/ticket/32792#comment:2>