Skip to content
Snippets Groups Projects
Commit c3924c23 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Use extra() instead of annotation to use constant value.

parent 6e5c68ea
No related branches found
No related tags found
No related merge requests found
......@@ -99,10 +99,10 @@ def lessons_day(request: HttpRequest, when: Optional[str] = None) -> HttpRespons
lesson_periods = LessonPeriod.objects.filter(
lesson__date_start__lte=day, lesson__date_end__gte=day,
period__weekday=weekday
).annotate(_week=week).all()
)
# Build table
lessons_table = LessonsTable(lesson_periods)
lessons_table = LessonsTable(lesson_periods.extra(select = {'_week': week}).all())
RequestConfig(request).configure(lessons_table)
context['lessons_table'] = lessons_table
......
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