diff options
author | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-05-01 19:32:32 (GMT) |
---|---|---|
committer | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-05-01 19:32:32 (GMT) |
commit | 3dde0e9f3d6df71d962a8a409b11afe12762309b (patch) | |
tree | 7a30f1932ecefe696af36f58e3347c2023b40b8b /program | |
parent | f08a6076ed4a0fdfdc0281ff4a8cac5bbd157c8c (diff) |
fill empty timeslots in day and week schedule views with a default show.
Diffstat (limited to 'program')
-rw-r--r-- | program/views.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/program/views.py b/program/views.py index d3e72f5..52f7355 100644 --- a/program/views.py +++ b/program/views.py @@ -45,7 +45,9 @@ def day_schedule(request, year=None, month=None, day=None): recommendations = Note.objects.filter(status=1, timeslot__start__range=(today, tomorrow)) - extra_context = dict(day=today, recommendations=recommendations) + default_show = Show.objects.get(pk=1) + + extra_context = dict(day=today, recommendations=recommendations, default_show=default_show) timeslots = TimeSlot.objects.get_day_timeslots(today) @@ -80,7 +82,9 @@ def week_schedule(request, year=None, week=None): saturday = monday+timedelta(days=5) sunday = monday+timedelta(days=6) - extra_context = dict(monday=monday, tuesday=tuesday, wednesday=wednesday, thursday=thursday, friday=friday, saturday=saturday, sunday=sunday) + default_show = Show.objects.get(pk=1) + + extra_context = dict(monday=monday, tuesday=tuesday, wednesday=wednesday, thursday=thursday, friday=friday, saturday=saturday, sunday=sunday, default_show=default_show) extra_context['monday_timeslots'] = TimeSlot.objects.get_day_timeslots(monday) extra_context['tuesday_timeslots'] = TimeSlot.objects.get_day_timeslots(tuesday) |