1
0
Fork 0

584 sorting of lists

This commit is contained in:
Pablo Barton 2021-04-08 12:05:21 -04:00
parent 797c3a12c8
commit f6824268ed
14 changed files with 2048 additions and 293 deletions

View file

@ -3,7 +3,7 @@ import datetime
from collections import defaultdict
from django import forms
from django.forms import ModelForm, PasswordInput, widgets
from django.forms import ModelForm, PasswordInput, widgets, ChoiceField
from django.forms.widgets import Textarea
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
@ -287,3 +287,20 @@ class ServerForm(CustomForm):
class Meta:
model = models.FederatedServer
exclude = ["remote_id"]
class SortListForm(forms.Form):
sort_by = ChoiceField(
choices=(
("order", _("List Order")),
("title", _("Book Title")),
("rating", _("Rating")),
),
label=_("Sort By"),
)
direction = ChoiceField(
choices=(
("ascending", _("Ascending")),
("descending", _("Descending")),
),
)