From 9d4791b65ad5bbcd01cd2cc21ec838a86896a7b7 Mon Sep 17 00:00:00 2001 From: Jens Gutermuth Date: Mon, 23 Mar 2015 02:30:54 +0100 Subject: [PATCH] image can be loaded with a join as well (saves another query) --- pinry/core/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinry/core/api.py b/pinry/core/api.py index ea7d30d..6cfa069 100644 --- a/pinry/core/api.py +++ b/pinry/core/api.py @@ -139,7 +139,7 @@ class PinResource(ModelResource): filtering = { 'submitter': ALL_WITH_RELATIONS } - queryset = Pin.objects.all().select_related('submitter'). \ + queryset = Pin.objects.all().select_related('submitter', 'image'). \ prefetch_related('image__thumbnail_set', 'tags') resource_name = 'pin' include_resource_uri = False