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

Add empty week days in between non-empty, advances #6.

parent 5ffb3e12
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,11 @@ def timetable(request):
per_day.setdefault(lesson_period.period.weekday,
[]).append(lesson_period)
# Fill in weekdays without lessons (to get a compet timetable)
for weekday_num in range(min(per_day.keys()), max(per_day.keys()) + 1):
if weekday_num not in per_day.keys():
per_day[weekday_num] = []
context['lesson_periods'] = OrderedDict(sorted(per_day.items()))
context['filter_descs'] = ', '.join(filter_descs)
context['periods'] = TimePeriod.get_times_dict()
......
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