[v3,1/5] REST: Prefetch Series.project

Submitted by Stephen Finucane on March 16, 2017, 10:07 p.m.

Details

Message ID 20170316220728.10817-2-stephen@that.guru
State Accepted
Headers show

Commit Message

Stephen Finucane March 16, 2017, 10:07 p.m.
I missed this when testing due to only having a single project. There
will be performance issues on instances using multiple projects.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
---
 patchwork/api/series.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/patchwork/api/series.py b/patchwork/api/series.py
index f66f0d2..3d5847b 100644
--- a/patchwork/api/series.py
+++ b/patchwork/api/series.py
@@ -51,7 +51,7 @@  class SeriesMixin(object):
 
     def get_queryset(self):
         return Series.objects.all().prefetch_related('patches',)\
-            .select_related('submitter', 'cover_letter')
+            .select_related('submitter', 'cover_letter', 'project')
 
 
 class SeriesList(SeriesMixin, ListAPIView):