mrts / django-admin-list-filter-dropdown

Use dropdowns in Django admin list filter
MIT License
315 stars 48 forks source link

BooleanField filter as a dropdown too #24

Closed moccand closed 2 years ago

moccand commented 2 years ago

BooleanField are not shown as a dropdown. Am I doing wrong ?

my model : visible = models.BooleanField(blank=True, null=True)

my admin : list_filter = [ ('visible', DropdownFilter),]

mrts commented 2 years ago

Currently the filter appears only when there are more than 3 choices: https://github.com/mrts/django-admin-list-filter-dropdown/blob/master/django_admin_listfilter_dropdown/templates/django_admin_listfilter_dropdown/dropdown_filter.html#L5

So, you are not doing anything wrong, this is intended behaviour.