From d19033ea0809230e143e86dcba28332d72f7e0bf Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Fri, 9 Feb 2018 22:45:45 +0300 Subject: [PATCH] Add gallery to select_related --- api/v1/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1/views.py b/api/v1/views.py index ea96b54e..043c0fb8 100644 --- a/api/v1/views.py +++ b/api/v1/views.py @@ -73,7 +73,7 @@ class CategoryViewSet(ExtendedModelViewSet): class CourseViewSet(ExtendedModelViewSet): queryset = Course.objects.select_related( - 'author', 'category', 'cover', + 'author', 'category', 'cover', 'gallery', ).prefetch_related( 'likes', 'materials', 'content', ).all()