summaryrefslogtreecommitdiff
path: root/program/views.py
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2017-04-27 16:13:37 (GMT)
committerChristian Pointner <equinox@helsinki.at>2017-04-27 16:13:37 (GMT)
commitf7f76cef63b6a274d3f5836b53508f343840d089 (patch)
treebeebe17a0c020e5a70a758027eab510da2898000 /program/views.py
parentda67f298b845aef31403dafe73942207486dedf8 (diff)
parente1ea1fd45cd3aaa9b89e107fa22dfd95c7a34f77 (diff)
Merge branch 'master' into stable
Diffstat (limited to 'program/views.py')
-rw-r--r--program/views.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/program/views.py b/program/views.py
index 9886d08..a9c83e4 100644
--- a/program/views.py
+++ b/program/views.py
@@ -193,14 +193,14 @@ def json_day_schedule(request, year=None, month=None, day=None):
else:
today = datetime.strptime('%s__%s__%s__00__00' % (year, month, day), '%Y__%m__%d__%H__%M')
- timeslots = TimeSlot.objects.get_24h_timeslots(today).select_related('programslot')
+ timeslots = TimeSlot.objects.get_24h_timeslots(today).select_related('programslot').select_related('show')
schedule = []
for ts in timeslots:
entry = {
'start': ts.start.strftime('%Y-%m-%d_%H:%M:%S'),
'end': ts.end.strftime('%Y-%m-%d_%H:%M:%S'),
- 'title': ts.programslot.show.name,
- 'id': ts.programslot.show.id,
+ 'title': ts.show.name,
+ 'id': ts.show.id,
'automation-id': -1
}
@@ -220,10 +220,10 @@ def json_timeslots_specials(request):
if show['type'] == 's':
specials[show['id']] = show
- for ts in TimeSlot.objects.filter(end__gt=datetime.now).filter(programslot__automation_id__in=specials.iterkeys()):
+ for ts in TimeSlot.objects.filter(end__gt=datetime.now, programslot__automation_id__in=specials.iterkeys()).select_related('show'):
automation_id = ts.programslot.automation_id
- specials[automation_id]['pv_id'] = int(ts.programslot.show.id)
- specials[automation_id]['pv_name'] = ts.programslot.show.name
+ specials[automation_id]['pv_id'] = int(ts.show.id)
+ specials[automation_id]['pv_name'] = ts.show.name
specials[automation_id]['pv_start'] = ts.start.strftime('%Y-%m-%d_%H:%M:%S')
specials[automation_id]['pv_end'] = ts.end.strftime('%Y-%m-%d_%H:%M:%S')