diff options
author | nnrcschmdt <e.rico.schmidt@gmail.com> | 2017-06-13 00:40:58 (GMT) |
---|---|---|
committer | nnrcschmdt <e.rico.schmidt@gmail.com> | 2017-06-13 00:40:58 (GMT) |
commit | e0fe86232a5d2cead375aaf5c133ed7809a18323 (patch) | |
tree | 433dba4280ff86818884ce90f7945aafccf8f681 /program/views.py | |
parent | 3838b4d64823868755d4a08a574b94f39fd06fb4 (diff) |
reverted back to callable datetime functions
Diffstat (limited to 'program/views.py')
-rw-r--r-- | program/views.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/program/views.py b/program/views.py index a9c83e4..ddc38cb 100644 --- a/program/views.py +++ b/program/views.py @@ -15,7 +15,7 @@ from program.utils import tofirstdayinisoweek, get_cached_shows class HostListView(ListView): context_object_name = 'host_list' - queryset = Host.objects.filter(Q(is_always_visible=True) | Q(shows__programslots__until__gt=datetime.now)).distinct() + queryset = Host.objects.filter(Q(is_always_visible=True) | Q(shows__programslots__until__gt=datetime.now())).distinct() template_name = 'host_list.html' @@ -212,6 +212,7 @@ def json_day_schedule(request, year=None, month=None, day=None): return HttpResponse(json.dumps(schedule, ensure_ascii=False, encoding='utf8').encode('utf8'), content_type="application/json; charset=utf-8") + def json_timeslots_specials(request): specials = {} shows = get_cached_shows()['shows'] @@ -220,7 +221,8 @@ def json_timeslots_specials(request): if show['type'] == 's': specials[show['id']] = show - for ts in TimeSlot.objects.filter(end__gt=datetime.now, programslot__automation_id__in=specials.iterkeys()).select_related('show'): + 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.show.id) specials[automation_id]['pv_name'] = ts.show.name |