From 097da148be036b3043d3b15ea5fd6fe77587f8b0 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Tue, 26 Oct 2021 20:17:53 +1100 Subject: [PATCH] sort shelves by latest shelved date Display the latest 2 books to be shelved in each shelf, when in the homepage feed view. fixes #1576 --- bookwyrm/views/feed.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bookwyrm/views/feed.py b/bookwyrm/views/feed.py index 8eff848c3..4f30387aa 100644 --- a/bookwyrm/views/feed.py +++ b/bookwyrm/views/feed.py @@ -224,6 +224,7 @@ def get_suggested_books(user, max_books=5): .filter( shelfbook__shelf=shelf, ) + .order_by('-shelfbook__shelved_date') .prefetch_related("authors")[:limit], } suggested_books.append(shelf_preview)