From 521daaac027526db4dd8b59d4f14a985570d826a Mon Sep 17 00:00:00 2001 From: mirabilos <thorsten.glaser@teckids.org> Date: Wed, 4 Sep 2019 00:36:12 +0200 Subject: [PATCH] =?UTF-8?q?It=E2=80=99s=20not=20as=20easy=E2=80=A6=20it?= =?UTF-8?q?=E2=80=99s=20ManyToMany.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- biscuit/apps/alsijil/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biscuit/apps/alsijil/views.py b/biscuit/apps/alsijil/views.py index b8c9ac44f..9df61b1ac 100644 --- a/biscuit/apps/alsijil/views.py +++ b/biscuit/apps/alsijil/views.py @@ -99,7 +99,7 @@ def group_week(request: HttpRequest, week: Optional[int] = None) -> HttpResponse periods_by_day_unsorted = {} if group: for act_group in [group] + list(group.child_groups.all()): - for lesson in act_group.lessons.select_related( + for lesson in act_group.lessons.prefetch_related( 'lesson_period', 'lesson_period__period', 'lesson_period__period__lesson__teachers' -- GitLab