From 459cfd6f0f9516678d5a0e152e5cbd0991303f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20Bouttier?= Date: Tue, 1 Aug 2017 14:31:18 +0200 Subject: [PATCH] optimize database queries with prefetch_related --- cfp/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cfp/views.py b/cfp/views.py index d055de8..d47f51f 100644 --- a/cfp/views.py +++ b/cfp/views.py @@ -194,6 +194,7 @@ def talk_list(request, conference): glyphicon = 'sort' sort_urls[c] = url.urlencode() sort_glyphicons[c] = glyphicon + talks = talks.prefetch_related('speakers') return render(request, 'cfp/staff/talk_list.html', { 'show_filters': show_filters, 'talk_list': talks,