Add sort order field to search form
This commit is contained in:
parent
8a0d859a4a
commit
a0352e2b7c
1 changed files with 14 additions and 2 deletions
|
@ -27,7 +27,7 @@ class SearchForm(forms.Form):
|
|||
}
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
sort = forms.ChoiceField(
|
||||
label="Sort by",
|
||||
choices=[('1', 'Date'), ('2', 'Views'), ('3', 'Likes'), ('4', 'Relevance')],
|
||||
|
@ -39,7 +39,19 @@ class SearchForm(forms.Form):
|
|||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
sort_order = forms.ChoiceField(
|
||||
label="Sort order",
|
||||
choices=[('1', 'Descending'), ('2', 'Ascending')],
|
||||
initial='1',
|
||||
required=False,
|
||||
widget=forms.Select(
|
||||
attrs={
|
||||
'class': 'form-select',
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
mature = forms.ChoiceField(
|
||||
label="Filter by Mature",
|
||||
choices=[('1', 'All'),('2', 'General'), ('3', 'Mature/Adult')],
|
||||
|
|
Loading…
Reference in a new issue