Order user shelf previews by book shelved date

This commit is contained in:
Matthew Mincher 2024-07-21 12:39:05 +01:00
parent ab307388f4
commit acc68147dc
No known key found for this signature in database
GPG key ID: DDD0BC634D4934A7

View file

@ -55,7 +55,9 @@ class User(View):
{
"name": user_shelf.name,
"local_path": user_shelf.local_path,
"books": user_shelf.books.all()[:3],
"books": user_shelf.books.order_by(
"-shelfbook__shelved_date"
).all()[:3],
"size": user_shelf.books.count(),
}
)