From 057f70ea9cbe3cfd8888b9f854c67f6d5fc6e871 Mon Sep 17 00:00:00 2001 From: Michael Knepher Date: Sat, 29 Aug 2020 18:53:00 -0700 Subject: [PATCH] Add author sort --- cps/web.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cps/web.py b/cps/web.py index 3e6d7c63..a4b767a0 100644 --- a/cps/web.py +++ b/cps/web.py @@ -644,6 +644,10 @@ def books_list(data, sort, book_id, page): order = [db.Books.timestamp.desc()] if sort == 'old': order = [db.Books.timestamp] + if sort == 'authaz': + order = [db.Books.author_sort.asc()] + if sort == 'authza': + order = [db.Books.author_sort.desc()] if data == "rated": if current_user.check_visibility(constants.SIDEBAR_BEST_RATED):