Merge branch 'main' into admin-manually-activate-user
This commit is contained in:
commit
c0e541c7ed
6 changed files with 12 additions and 12 deletions
|
@ -68,7 +68,7 @@ class AnnualSummary(View):
|
|||
book_list_by_pages = read_books_in_year.filter(pages__gte=0).order_by("pages")
|
||||
|
||||
# books with no pages
|
||||
no_page_list = len(read_books_in_year.filter(pages__exact=None))
|
||||
no_page_list = read_books_in_year.filter(pages__exact=None).count()
|
||||
|
||||
# rating stats queries
|
||||
ratings = (
|
||||
|
@ -95,13 +95,13 @@ class AnnualSummary(View):
|
|||
"book_pages_lowest": book_list_by_pages.first(),
|
||||
"book_pages_highest": book_list_by_pages.last(),
|
||||
"no_page_number": no_page_list,
|
||||
"ratings_total": len(ratings),
|
||||
"ratings_total": ratings.count(),
|
||||
"rating_average": round(
|
||||
ratings_stats["rating__avg"] if ratings_stats["rating__avg"] else 0, 2
|
||||
),
|
||||
"book_rating_highest": ratings.order_by("-rating").first(),
|
||||
"best_ratings_books_ids": [
|
||||
review.book.id for review in ratings.filter(rating=5)
|
||||
review.book_id for review in ratings.filter(rating=5)
|
||||
],
|
||||
"paginated_years": paginated_years,
|
||||
"goal_status": goal_status,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue