From aa0ffd86c0ac3fa227f11afa41432ce9aab7fb41 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 20 Sep 2021 14:49:07 -0700 Subject: [PATCH] Fetch related items when loading list page --- bookwyrm/views/list.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bookwyrm/views/list.py b/bookwyrm/views/list.py index af99e9f55..8e600490a 100644 --- a/bookwyrm/views/list.py +++ b/bookwyrm/views/list.py @@ -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() )