You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class MyModel(models.Model):
notifications = BitField(flags=('facebook', 'phone', 'gmail'))
Say facebook, gmail are active, then in list view(django-admin) want those flag label comma separated.
The text was updated successfully, but these errors were encountered:
maharshi-trendlyne
changed the title
How to present flags in django admin list view ( flags which are active)
How to present flags in django admin list view ( flags which are active )
Mar 4, 2020
You can define a method in your AdminModel to represent them as you want, and then list it in the list_display attr.
For instance, what I did is to list it in its own column named Features, and if the flag is ON show a ✅ , and if it's OFF a ❌
I have a model with BitField like this:
Say facebook, gmail are active, then in list view(django-admin) want those flag label comma separated.
The text was updated successfully, but these errors were encountered: