Answer by Denis for list_display - boolean icons for methods
Thanks to @daniel-roseman (rtfm)Since Django 3.2 there is a decorator@admin.display(boolean=True):If the string (in list_display) given is a method of the model,ModelAdmin or a callable that returns...
View ArticleAnswer by Daniel Roseman for list_display - boolean icons for methods
This is documented, although it's a bit hard to find - go a couple of screens down from here, and you'll find this:If the string given is a method of the model, ModelAdmin or a callable that returns...
View Articlelist_display - boolean icons for methods
When defining the list_display array for a ModelAdmin class, if a BooleanField or NullBooleanField is given the UI will use nice looking icons instead of True/False text in the column. If a method that...
View ArticleAnswer by Shmuelt for list_display - boolean icons for methods
I got this to work for me (Django 3.1.10)class MyAdmin(MyModel): list_display = ("field_as_boolean", ) def field_as_boolean(self, obj): return True if obj.field else False field_as_boolean.boolean =...
View Article
More Pages to Explore .....