Django-filter | first filter "------"

enter image description here

I want to rename first filter (all), now its like "--------", question is: how to let it name

filters.py:

class DoctorsFilter(django_filters.FilterSet):
    category = ModelChoiceFilter(queryset=DoctorCategory.objects.all().order_by('category'),
            widget=forms.Select(attrs={"onchange":"submit();"}),
                     label='')

    class Meta:
        model = Doctors
        fields = ['category']

According to the docs you can set

FILTERS_EMPTY_CHOICE_LABEL = "(all)"

in settings.py

Back to Top