Merge branch 'main' into group-list-button

This commit is contained in:
Hugh Rundle
2022-01-03 10:28:59 +11:00
20 changed files with 907 additions and 886 deletions

View File

@ -72,9 +72,13 @@ class Shelf(View):
"start_date"
)
if shelf_identifier:
books = books.annotate(shelved_date=F("shelfbook__shelved_date"))
else:
# sorting by shelved date will cause duplicates in the "all books" view
books = books.annotate(shelved_date=F("updated_date"))
books = books.annotate(
rating=Subquery(reviews.values("rating")[:1]),
shelved_date=F("shelfbook__shelved_date"),
start_date=Subquery(reading.values("start_date")[:1]),
finish_date=Subquery(reading.values("finish_date")[:1]),
author=Subquery(