Prefect related data in author view

This commit is contained in:
Mouse Reeve 2021-10-20 18:04:29 -07:00
parent de93beca84
commit 14682ed8c6

View file

@ -34,7 +34,7 @@ class Author(View):
) )
.annotate(default_id=Subquery(default_editions.values("id")[:1])) .annotate(default_id=Subquery(default_editions.values("id")[:1]))
.filter(default_id=F("id")) .filter(default_id=F("id"))
) ).prefetch_related("authors")
paginated = Paginator(books, PAGE_LENGTH) paginated = Paginator(books, PAGE_LENGTH)
page = paginated.get_page(request.GET.get("page")) page = paginated.get_page(request.GET.get("page"))