mirror of
https://github.com/pinry/pinry.git
synced 2025-11-14 17:05:50 +01:00
image can be loaded with a join as well (saves another query)
This commit is contained in:
@@ -139,7 +139,7 @@ class PinResource(ModelResource):
|
|||||||
filtering = {
|
filtering = {
|
||||||
'submitter': ALL_WITH_RELATIONS
|
'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')
|
prefetch_related('image__thumbnail_set', 'tags')
|
||||||
resource_name = 'pin'
|
resource_name = 'pin'
|
||||||
include_resource_uri = False
|
include_resource_uri = False
|
||||||
|
|||||||
Reference in New Issue
Block a user