mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-12 10:15:29 +00:00
updating list view
This commit is contained in:
parent
21d9cb5fe5
commit
a3013c6224
1 changed files with 2 additions and 2 deletions
|
@ -129,7 +129,7 @@ def sort_list(request, items):
|
||||||
"""helper to handle the surprisingly involved sorting"""
|
"""helper to handle the surprisingly involved sorting"""
|
||||||
# sort_by shall be "order" unless a valid alternative is given
|
# sort_by shall be "order" unless a valid alternative is given
|
||||||
sort_by = request.GET.get("sort_by", "order")
|
sort_by = request.GET.get("sort_by", "order")
|
||||||
if sort_by not in ("order", "title", "rating"):
|
if sort_by not in ("order", "sort_title", "rating"):
|
||||||
sort_by = "order"
|
sort_by = "order"
|
||||||
|
|
||||||
# direction shall be "ascending" unless a valid alternative is given
|
# direction shall be "ascending" unless a valid alternative is given
|
||||||
|
@ -139,7 +139,7 @@ def sort_list(request, items):
|
||||||
|
|
||||||
directional_sort_by = {
|
directional_sort_by = {
|
||||||
"order": "order",
|
"order": "order",
|
||||||
"title": "book__title",
|
"sort_title": "book__sort_title",
|
||||||
"rating": "average_rating",
|
"rating": "average_rating",
|
||||||
}[sort_by]
|
}[sort_by]
|
||||||
if direction == "descending":
|
if direction == "descending":
|
||||||
|
|
Loading…
Reference in a new issue