mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 12:01:14 +00:00
Fetch related items when loading list page
This commit is contained in:
parent
22ead6ba46
commit
aa0ffd86c0
1 changed files with 2 additions and 0 deletions
|
@ -36,6 +36,8 @@ class Lists(View):
|
||||||
item_count=Count("listitem", filter=Q(listitem__approved=True))
|
item_count=Count("listitem", filter=Q(listitem__approved=True))
|
||||||
)
|
)
|
||||||
.filter(item_count__gt=0)
|
.filter(item_count__gt=0)
|
||||||
|
.select_related("user")
|
||||||
|
.prefetch_related("listitem_set")
|
||||||
.order_by("-updated_date")
|
.order_by("-updated_date")
|
||||||
.distinct()
|
.distinct()
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue