Django_filters ModelChoiceFilter display text input
Filters actually construct an underlying Django form Field in order to perform input validation, rendering, etc... Arguments that the filter does not expect are passed to the form field's constructor. If you want to use a plain text input, then you can simply pass the appropriate widget to the Filter.
I am using Django_filters to create filters. I have to use ModelChoiceFilter due to foreign key in models. The filter automatically returns a drop down list, is there a way to display a text input box instead of drop down list when I use ModelChoiceFilter? Thanks
code:
GPA = django_filters.ModelChoiceFilter(name='persontoschool__GPA',                                      queryset=PersonToSchool.objects.values_list('GPA',flat=True).distinct(),to_field_name='GPA', lookup_expr='gte')