diff --git a/biscuit/apps/chronos/tables.py b/biscuit/apps/chronos/tables.py index 2be4f6093f6fd4c3397d3762907fb0a5893bead6..7b5968b8a860a840481b4a7fccd24f68af9c9556 100644 --- a/biscuit/apps/chronos/tables.py +++ b/biscuit/apps/chronos/tables.py @@ -11,3 +11,7 @@ class LessonsTable(tables.Table): lesson__teachers = tables.Column(accessor='lesson.teacher_names') lesson__subject = tables.Column(accessor='lesson.subject') room = tables.Column(accessor='room') + + def __init__(self, week, *args, **kwargs): + self._week = week + super().__init__(*args, **kwargs) diff --git a/biscuit/apps/chronos/views.py b/biscuit/apps/chronos/views.py index 4a16f560d5273b85c9ae7ac8921d771d9ed3c097..7aa1e35944ce4c95f579c18c6b630b0294269458 100644 --- a/biscuit/apps/chronos/views.py +++ b/biscuit/apps/chronos/views.py @@ -102,7 +102,7 @@ def lessons_day(request: HttpRequest, when: Optional[str] = None) -> HttpRespons ).all() # Build table - lessons_table = LessonsTable(lesson_periods) + lessons_table = LessonsTable(week, lesson_periods) RequestConfig(request).configure(lessons_table) context['lessons_table'] = lessons_table