From df7a9cc855381b91be14c79bfd73714ed6512677 Mon Sep 17 00:00:00 2001 From: Benjamin Cutler Date: Sun, 5 Jan 2025 18:44:57 -0500 Subject: [PATCH] add some missing DB prefetches [#188745162] --- tracker/api/views/interview.py | 2 +- tracker/api/views/run.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tracker/api/views/interview.py b/tracker/api/views/interview.py index 05f360ebb..e83e13c4b 100644 --- a/tracker/api/views/interview.py +++ b/tracker/api/views/interview.py @@ -10,7 +10,7 @@ class InterviewViewSet(TrackerFullViewSet, EventCreateNestedMixin): - queryset = Interview.objects.select_related('event') + queryset = Interview.objects.select_related('event').prefetch_related('tags') serializer_class = InterviewSerializer pagination_class = TrackerPagination permission_classes = [*PrivateGenericPermissions('interview', lambda o: o.public)] diff --git a/tracker/api/views/run.py b/tracker/api/views/run.py index 764715286..362f33640 100644 --- a/tracker/api/views/run.py +++ b/tracker/api/views/run.py @@ -16,8 +16,10 @@ class SpeedRunViewSet( EventNestedMixin, TrackerFullViewSet, ): - queryset = SpeedRun.objects.select_related('event').prefetch_related( - 'runners', 'hosts', 'commentators', 'video_links__link_type' + queryset = SpeedRun.objects.select_related( + 'event', 'priority_tag' + ).prefetch_related( + 'runners', 'hosts', 'commentators', 'video_links__link_type', 'tags' ) serializer_class = SpeedRunSerializer pagination_class = TrackerPagination