Skip to content
Snippets Groups Projects
Verified Commit 2149555e authored by mirabilos's avatar mirabilos Committed by mirabilos
Browse files

Eager to fetch the teacher names as well.

Might cut amount of SQL queries by a lot, again.
parent 7fbbec18
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,8 @@ def group_week(request: HttpRequest, week: Optional[int] = None) -> HttpResponse
for act_group in [group] + list(group.child_groups.all()):
for lesson in act_group.lessons.select_related(
'lesson_period',
'lesson_period__period'
'lesson_period__period',
'lesson_period__period__lesson__teachers'
).filter(date_start__lte=week_start, date_end__gte=week_end):
for lesson_period in lesson.lesson_periods.all():
periods_by_day_unsorted.setdefault(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment