Answer the question
In order to leave comments, you need to log in
How to reorder fields in a Django FilterSet?
Good afternoon.
How to make the fields in the filter appear on the page in the order in which they are specified in the fields parameter?
Filters.py:
class CasesFilter(django_filters.FilterSet):
Field1=DateTimeFromToRangeFilter()
Field2=DateTimeFromToRangeFilter()
class Meta:
model = Model1
fields={'id' :['exact'],
'Field1':['exact'],
'Field2':['exact'],
'Field3':['exact'],
}
<div >
<form action="" method="get" class="form-inline">
{{filter.form|crispy }}
<input type="submit" value="Искать" />
</form>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question