Fetch related items when loading list page

This commit is contained in:
Mouse Reeve 2021-09-20 14:49:07 -07:00
parent 22ead6ba46
commit aa0ffd86c0

View file

@ -36,6 +36,8 @@ class Lists(View):
item_count=Count("listitem", filter=Q(listitem__approved=True))
)
.filter(item_count__gt=0)
.select_related("user")
.prefetch_related("listitem_set")
.order_by("-updated_date")
.distinct()
)