I am filtering data using django-filters, but i am getting an extra dots
in my dropdown, Please let me know How I can remove that Extra dots from my dropdown filters, I want to give the lable
there but I am unable to do that, Please check my code and let me know How I can solve thsi issue.
here is my filters.py
file...
class MyFilter(django_filters.FilterSet):
type = django_filters.ChoiceFilter(choices=Data_TYPE, field_name='data_type')
class Meta:
model = Project
fields = ['category', 'type', 'project_details__possession']
here is my test.html
file where I am displaying the filters in dropdown...
<form method="GET" action="">
<div class="dropdown bootstrap-select hero__form-input form-control custom-select">
{% render_field projectlist.form.category|attr:"type:select" class="hero__form-input form-control custom-select" onchange="this.form.submit()" %}
</div>
<div class="dropdown bootstrap-select hero__form-input form-control custom-select">
{% render_field projectlist.form.type|attr:"type:select" class="hero__form-input form-control custom-select" onchange="this.form.submit()" %}
</div>
<div class="dropdown bootstrap-select hero__form-input form-control custom-select">
{% render_field projectlist.form.project_details__possession|attr:"type:select" class="hero__form-input form-control custom-select" onchange="this.form.submit()" %}
</div>
</form>
here is the image, where iwant to remove the dots
and i want to replace with filter lable
...
Plase check this https://prnt.sc/vkif04
You can use the empty_label
parameter to set the value
class MyFilter(django_filters.FilterSet):
type = django_filters.ChoiceFilter(
choices=Data_TYPE,
field_name='data_type',
empty_label="Any string you want to put"
)
class Meta:
model = Project
fields = ['category', 'type']