From 86725d5f392c193e64dbc4d79733b4abdda1ff45 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Fri, 27 May 2016 17:37:25 +0200 Subject: Optimize selection of time slot by fetching the program slots diff --git a/program/views.py b/program/views.py index 5dc82dd..23aab75 100644 --- a/program/views.py +++ b/program/views.py @@ -27,7 +27,7 @@ class HostDetailView(DetailView): class ShowListView(ListView): context_object_name = 'show_list' - queryset = Show.objects.filter(is_active=True).exclude(id=1).distinct() + queryset = Show.objects.filter(is_active=True).exclude(id=1) template_name = 'show_list.html' def get_queryset(self): @@ -50,7 +50,7 @@ class ShowListView(ListView): class ShowDetailView(DetailView): - queryset = Show.objects.all().exclude(id=1) + queryset = Show.objects.exclude(id=1) template_name = 'show_detail.html' @@ -195,7 +195,7 @@ 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) + timeslots = TimeSlot.objects.get_24h_timeslots(today).select_related('programslot') schedule = [] for ts in timeslots: entry = { -- cgit v0.10.2 From 1592aba5539a703b31068100fef821ff443fcd1d Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Fri, 27 May 2016 17:38:07 +0200 Subject: Update to latest Django 1.8 version diff --git a/requirements.txt b/requirements.txt index 7a1f664..b895f65 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==1.8.12 +Django==1.8.13 MySQL-python==1.2.5 Pillow==3.2.0 PyYAML==3.11 -- cgit v0.10.2 From 5f1b7dec9166ef1bfeb09bca2a3f8899f27f27a5 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Fri, 27 May 2016 20:56:09 +0200 Subject: updated TODO diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..5921850 --- /dev/null +++ b/TODO.md @@ -0,0 +1,9 @@ +- [*] list notes of predecessor, if available, on show detail page +- [ ] list notes of successor, if available, on show detail page +- [*] optimize the export for the day schedule +- [ ] handle exceptions better +- [ ] optimize the selection of a predecessor for a show +- [ ] optimize the selection of a timeslot for a note +- [ ] add management command to automatically renew program slots +- [ ] add jingle field (File) to Show model +- [ ] customize the admin interface for program slot -- cgit v0.10.2