Fetch related items when loading list page
This commit is contained in:
parent
22ead6ba46
commit
aa0ffd86c0
|
@ -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 New Issue