I am try to add bootstrap class in to price range filter but i can't,
import django_filters
from panel.models import Product, Category,Size,TopNote, BaseNote, MidNote
from django import forms
class ProductFilter(django_filters.FilterSet):
price = django_filters.RangeFilter(
# widget = forms.TextInput(attrs={'class':'form-control'})
)
class Meta:
model = Product
fields =['name',
'category_id',
'price',
'top_notes', 'base_notes', 'category_id', 'size']
when I am add class using widget = forms.TextInput(attrs={'class':'form-control'}) range filter convert into 1 textbox i dont't know why ???/
The
RangeFilterfilter does not use theTextInputwidget. Instead, it uses theRangeWidgetwidget to produce more than one input field.The documentation states::
Read also the documentation about RangeWidget.