If, for a field that you want to filter by, you have more than ~10 values, the filtering sidebar starts to be ugly and harder to use.
I\'m looking for a solution to
I cannot comment answers so I'll add to beholderrk's answer here.
dropdown_filter.html or similardropdown_filter.htmlcreate a new filter class in filters.py:
from django.contrib.admin.filters import AllValuesFieldListFilter
class DropdownFilter(AllValuesFieldListFilter):
template = 'admin/dropdown_filter.html'
now you can use this filter in your admin class:
class SomeAdmin(admin.ModelAdmin):
# ...
list_filter = (('country', DropdownFilter),)
Works great!