From fa75617ab820bf23fecec6c038cc9b747a70ba4b Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Sat, 16 Apr 2016 19:09:01 +0200 Subject: updated requiremets and TODO list diff --git a/TODO b/TODO deleted file mode 100644 index e69de29..0000000 diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..76dc0b7 --- /dev/null +++ b/TODO.md @@ -0,0 +1,5 @@ +- [ ] list notes of predecessor, if available, on show detail page +- [ ] list notes of successor, if available to show detail page +- [ ] add management command to automatically renew program slots +- [ ] add jingle field (File) to Show model +- [ ] customize the admin interface for program slot diff --git a/requirements.txt b/requirements.txt index 22470f4..9b82779 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -Django==1.8.8 +Django==1.8.12 MySQL-python==1.2.5 -Pillow==3.0.0 +Pillow==3.2.0 PyYAML==3.11 -django-tinymce==2.0.6 -python-dateutil==2.4.2 +django-tinymce==2.3.0 +python-dateutil==2.5.2 -- cgit v0.10.2 From 7830905599daec37d1399b63ab7c02a2bce63e21 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Sat, 16 Apr 2016 19:26:43 +0200 Subject: simplified inline admin for program slots and time slots diff --git a/program/admin.py b/program/admin.py index e6c331a..406d73f 100644 --- a/program/admin.py +++ b/program/admin.py @@ -58,11 +58,12 @@ class NoteAdmin(admin.ModelAdmin): class TimeSlotInline(admin.TabularInline): model = TimeSlot - + ordering = ('-end',) class ProgramSlotAdmin(admin.ModelAdmin): actions = ('renew',) inlines = (TimeSlotInline,) + fields = (('rrule', 'byweekday'), ('dstart', 'tstart', 'tend'), 'until', 'is_repetition', 'automation_id') list_display = ('show', 'byweekday', 'rrule', 'tstart', 'tend', 'until') list_filter = ('byweekday', 'rrule', 'is_repetition', 'is_active') ordering = ('byweekday', 'dstart') @@ -83,7 +84,7 @@ class ProgramSlotAdmin(admin.ModelAdmin): class ProgramSlotInline(admin.TabularInline): model = ProgramSlot - + ordering = ('-until',) class ShowAdmin(admin.ModelAdmin): filter_horizontal = ('hosts', 'owners', 'musicfocus', 'showinformation', 'showtopic') -- cgit v0.10.2 From e70db7a684cbfd2c449688f1f921c2e747cdef12 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Sat, 16 Apr 2016 19:47:45 +0200 Subject: removed cba_entry_id and cba_series_id from Show and Time Slot models diff --git a/program/migrations/0006_note_remove_cba_entry_id.py b/program/migrations/0006_note_remove_cba_entry_id.py new file mode 100644 index 0000000..e16da83 --- /dev/null +++ b/program/migrations/0006_note_remove_cba_entry_id.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0005_programslot_is_active'), + ] + + operations = [ + migrations.RemoveField( + model_name='note', + name='cba_entry_id', + ), + ] diff --git a/program/migrations/0007_show_remove_cba_series_id.py b/program/migrations/0007_show_remove_cba_series_id.py new file mode 100644 index 0000000..5c9f161 --- /dev/null +++ b/program/migrations/0007_show_remove_cba_series_id.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0006_note_remove_cba_entry_id'), + ] + + operations = [ + migrations.RemoveField( + model_name='show', + name='cba_series_id', + ), + ] diff --git a/program/models.py b/program/models.py index d755248..52b5517 100644 --- a/program/models.py +++ b/program/models.py @@ -244,7 +244,6 @@ class Show(models.Model): email = models.EmailField(_("E-Mail"), blank=True, null=True) website = models.URLField(_("Website"), blank=True, null=True) is_active = models.BooleanField(_("Is active"), default=True, editable=False) - cba_series_id = models.IntegerField(_("CBA series ID"), blank=True, null=True) automation_id = models.IntegerField(_("Automation ID"), blank=True, null=True, choices=get_automation_id_choices()) created = models.DateTimeField(auto_now_add=True, editable=False) last_updated = models.DateTimeField(auto_now=True, editable=False) @@ -483,7 +482,6 @@ class Note(models.Model): title = models.CharField(_("Title"), max_length=128) content = tinymce_models.HTMLField(_("Content")) status = models.IntegerField(_("Status"), choices=STATUS_CHOICES, default=1) - cba_entry_id = models.IntegerField(_("CBA entry ID"), blank=True, null=True) start = models.DateTimeField(editable=False) show = models.ForeignKey(Show, editable=False, related_name='notes') created = models.DateTimeField(auto_now_add=True, editable=False) -- cgit v0.10.2 From 1d3301368c60efcb62dd4161e9e464c924b8f4d3 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Sat, 16 Apr 2016 19:49:03 +0200 Subject: removed unused templates diff --git a/pv/templates/404.html b/pv/templates/404.html deleted file mode 100644 index 6281ba0..0000000 --- a/pv/templates/404.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Seite nicht gefunden{% endblock %} - -{% block content %} -

Es tut uns leid, aber die angeforderte Seite konnte nicht gefunden werden.

-{% endblock %} \ No newline at end of file diff --git a/pv/templates/500.html b/pv/templates/500.html deleted file mode 100644 index 98074ab..0000000 --- a/pv/templates/500.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Serverfehler{% endblock %} - -{% block content %} -

- Ein Fehler ist aufgetreten. - Dieser Fehler wurde an die Serververwalter per E-Mail gemeldet und sollte in Kürze behoben sein. - Vielen Dank für Ihr Verständnis. -

-{% endblock %} \ No newline at end of file diff --git a/pv/templates/base.html b/pv/templates/base.html deleted file mode 100644 index 2ed539e..0000000 --- a/pv/templates/base.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - {% block title %}{% endblock %} - - - -{% block content %}{% endblock %} - - - \ No newline at end of file -- cgit v0.10.2 From 3c78c9f3f4af3c52725947f277e37938fd6d4f08 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Tue, 19 Apr 2016 20:25:37 +0200 Subject: fixed pep8/flake8 warnings. again. diff --git a/nop/urls.py b/nop/urls.py index 3cc97a4..392d633 100644 --- a/nop/urls.py +++ b/nop/urls.py @@ -10,4 +10,4 @@ urlpatterns = patterns('', url(r'^/(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/(?P\d{1,2})/(?P\d{1,2})/?$', get), url(r'^/?$', nop_form), url(r'^/static/(?P.*)$', 'django.views.static.serve', {'document_root': NOP_SITE_MEDIA}), -) + ) diff --git a/program/admin.py b/program/admin.py index 406d73f..1323697 100644 --- a/program/admin.py +++ b/program/admin.py @@ -60,6 +60,7 @@ class TimeSlotInline(admin.TabularInline): model = TimeSlot ordering = ('-end',) + class ProgramSlotAdmin(admin.ModelAdmin): actions = ('renew',) inlines = (TimeSlotInline,) @@ -86,6 +87,7 @@ class ProgramSlotInline(admin.TabularInline): model = ProgramSlot ordering = ('-until',) + class ShowAdmin(admin.ModelAdmin): filter_horizontal = ('hosts', 'owners', 'musicfocus', 'showinformation', 'showtopic') inlines = (ProgramSlotInline,) diff --git a/program/management/commands/addnote.py b/program/management/commands/addnote.py index 01d891e..5c0147e 100644 --- a/program/management/commands/addnote.py +++ b/program/management/commands/addnote.py @@ -1,4 +1,3 @@ -from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ValidationError @@ -7,6 +6,7 @@ import sys from program.models import Show, TimeSlot, Note + class Command(BaseCommand): help = 'adds a note to a timeslot' args = ' [index]' @@ -40,11 +40,13 @@ class Command(BaseCommand): timeslot = TimeSlot.objects.get(show=show, start__year=year, start__month=month, start__day=day) except TimeSlot.DoesNotExist as dne: raise CommandError(dne) - except TimeSlot.MultipleObjectsReturned as mor: + except TimeSlot.MultipleObjectsReturned: if not index: - raise CommandError('you must provide the show_id, start_date, status index') + raise CommandError('you must provide the show_id, start_date, status index') try: - timeslot = TimeSlot.objects.filter(show=show, start__year=year, start__month=month, start__day=day).order_by('start')[int(index)] + timeslot = \ + TimeSlot.objects.filter(show=show, start__year=year, start__month=month, start__day=day).order_by( + 'start')[int(index)] except IndexError as ie: raise CommandError(ie) @@ -63,4 +65,3 @@ class Command(BaseCommand): else: note.save() print 'added note "%s" to "%s"' % (title, timeslot) - diff --git a/program/management/commands/cleanup_defaultshow.py b/program/management/commands/cleanup_defaultshow.py index 2f6ccca..98d3f98 100644 --- a/program/management/commands/cleanup_defaultshow.py +++ b/program/management/commands/cleanup_defaultshow.py @@ -3,10 +3,12 @@ from django.db import transaction from program.models import Show, TimeSlot, ProgramSlot + class Command(NoArgsCommand): + help = 'removes default shows without note' + @transaction.commit_manually def handle_noargs(self, **options): - help = 'removes default shows without note' default_show = Show.objects.get(pk=1) try: @@ -18,4 +20,3 @@ class Command(NoArgsCommand): transaction.rollback() else: transaction.commit() - diff --git a/program/management/commands/createuser.py b/program/management/commands/createuser.py index a356bb3..a78c101 100644 --- a/program/management/commands/createuser.py +++ b/program/management/commands/createuser.py @@ -3,6 +3,7 @@ from django.core.management.base import BaseCommand, CommandError from optparse import make_option + class Command(BaseCommand): help = 'creates an user' option_list = BaseCommand.option_list + ( diff --git a/program/management/commands/deleteuser.py b/program/management/commands/deleteuser.py index 27ce61e..db2cb60 100644 --- a/program/management/commands/deleteuser.py +++ b/program/management/commands/deleteuser.py @@ -3,6 +3,7 @@ from django.core.management.base import BaseCommand, CommandError from optparse import make_option + class Command(BaseCommand): help = 'deletes an user' option_list = BaseCommand.option_list + ( @@ -19,4 +20,4 @@ class Command(BaseCommand): except User.DoesNotExist: raise 'user does not exist.' else: - print 'user deleted succesfuly.' \ No newline at end of file + print 'user deleted succesfuly.' diff --git a/program/management/commands/importhosts.py b/program/management/commands/importhosts.py index 1ecabef..31f4a3f 100644 --- a/program/management/commands/importhosts.py +++ b/program/management/commands/importhosts.py @@ -8,6 +8,7 @@ USER = 'helsinki' PASSWD = 'helsinki' DB = 'helsinki' + class Command(NoArgsCommand): help = 'Import hosts from current program' diff --git a/program/management/commands/importnotes.py b/program/management/commands/importnotes.py index 287dcef..0a1ab0f 100644 --- a/program/management/commands/importnotes.py +++ b/program/management/commands/importnotes.py @@ -1,7 +1,6 @@ -from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned, ValidationError from django.core.management.base import NoArgsCommand -from django.utils.html import clean_html, strip_tags +from django.utils.html import strip_tags import MySQLdb @@ -11,6 +10,7 @@ USER = 'helsinki' PASSWD = 'helsinki' DB = 'helsinki' + class Command(NoArgsCommand): help = 'Import notes from current program' @@ -26,7 +26,7 @@ WHERE n.sendung_id in (SELECT id FROM sendungen WHERE letzter_termin > current_d for ntitel, datum, stitel, notiz in cursor.fetchall(): ntitel = strip_tags(ntitel) if ntitel else strip_tags(stitel) stitel = strip_tags(stitel) - notiz = clean_html(notiz) + notiz = strip_tags(notiz) if stitel.endswith('(Wiederholung)'): stitel = stitel[:-15] @@ -39,7 +39,8 @@ WHERE n.sendung_id in (SELECT id FROM sendungen WHERE letzter_termin > current_d print 'show with name "%s" not found' % stitel else: try: - timeslot = TimeSlot.objects.get(programslot__show=show, start__year=year, start__month=month, start__day=day) + timeslot = TimeSlot.objects.get(programslot__show=show, start__year=year, start__month=month, + start__day=day) except ObjectDoesNotExist: print 'no timeslot found for sendung "%s" and datum "%s"' % (stitel, datum) except MultipleObjectsReturned: diff --git a/program/management/commands/importprogramslots.py b/program/management/commands/importprogramslots.py index ce4f60e..b527f53 100644 --- a/program/management/commands/importprogramslots.py +++ b/program/management/commands/importprogramslots.py @@ -18,6 +18,7 @@ RRULES = { 28: RRule.objects.get(pk=5) } + class Command(NoArgsCommand): help = 'Import programslots from the current program' @@ -49,8 +50,8 @@ WHERE letzter_termin > current_date AND titel NOT LIKE 'Musikprogramm' AND titel except ObjectDoesNotExist: print 'show with name "%s" not found' % titel else: - programslot = ProgramSlot(rrule=rrule, byweekday=termin, show=show, dstart=erster_termin, tstart=tstart, - tend=tend, until=letzter_termin) + programslot = ProgramSlot(rrule=rrule, byweekday=termin, show=show, dstart=erster_termin, + tstart=tstart, tend=tend, until=letzter_termin) try: programslot.save() counter += 1 @@ -81,7 +82,8 @@ WHERE letzter_termin > current_date AND titel LIKE '%%(Wiederholung)'""") except ObjectDoesNotExist: print 'show with name "%s" not found' % titel else: - programslot = ProgramSlot(rrule=rrule, byweekday=termin, show=show, dstart=erster_termin, tstart=tstart, tend=tend, until=letzter_termin, is_repetition=True) + programslot = ProgramSlot(rrule=rrule, byweekday=termin, show=show, dstart=erster_termin, + tstart=tstart, tend=tend, until=letzter_termin, is_repetition=True) try: programslot.save() counter += 1 diff --git a/program/management/commands/importshows.py b/program/management/commands/importshows.py index d5fdee7..f1353b8 100644 --- a/program/management/commands/importshows.py +++ b/program/management/commands/importshows.py @@ -1,7 +1,7 @@ from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.core.management.base import NoArgsCommand from django.template.defaultfilters import slugify -from django.utils.html import clean_html, strip_tags +from django.utils.html import strip_tags import MySQLdb @@ -13,9 +13,10 @@ DB = 'helsinki' TALK = BroadcastFormat.objects.get(pk=1) + class Command(NoArgsCommand): help = 'Import shows from the current program' - + def handle_noargs(self, **options): connection = MySQLdb.connect(user=USER, passwd=PASSWD, db=DB) cursor = connection.cursor() @@ -29,7 +30,7 @@ ORDER BY titel, beginn, ende""") for titel, beschreibung, web, macher in cursor.fetchall(): titel = strip_tags(titel) - beschreibung = clean_html(beschreibung) + beschreibung = strip_tags(beschreibung) slug = slugify(titel) @@ -50,7 +51,8 @@ ORDER BY titel, beginn, ende""") show = Show.objects.get(name=titel) print 'sendung "%s" already imported as show "%s"' % (titel, show) except ObjectDoesNotExist: - show = Show(broadcastformat=TALK, name=titel, slug=slug, short_description='FIXME', description=beschreibung) + show = Show(broadcastformat=TALK, name=titel, slug=slug, short_description='FIXME', + description=beschreibung) try: show.save() counter += 1 diff --git a/program/migrations/0006_note_remove_cba_entry_id.py b/program/migrations/0006_note_remove_cba_entry_id.py index e16da83..d04be57 100644 --- a/program/migrations/0006_note_remove_cba_entry_id.py +++ b/program/migrations/0006_note_remove_cba_entry_id.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/program/migrations/0007_show_remove_cba_series_id.py b/program/migrations/0007_show_remove_cba_series_id.py index 5c9f161..1173b51 100644 --- a/program/migrations/0007_show_remove_cba_series_id.py +++ b/program/migrations/0007_show_remove_cba_series_id.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.db import migrations, models +from django.db import migrations class Migration(migrations.Migration): diff --git a/program/templatetags/content_boxes.py b/program/templatetags/content_boxes.py index 7f176c6..2d1745e 100644 --- a/program/templatetags/content_boxes.py +++ b/program/templatetags/content_boxes.py @@ -1,10 +1,9 @@ -# http://docs.djangoproject.com/en/1.2/howto/custom-template-tags/ - from django import template -register = template.Library() from program.models import BroadcastFormat, MusicFocus, ShowInformation, ShowTopic +register = template.Library() + @register.inclusion_tag('boxes/broadcastformat.html') def broadcastformat(): diff --git a/program/templatetags/timeslots.py b/program/templatetags/timeslots.py index c2c44b5..08e45b1 100644 --- a/program/templatetags/timeslots.py +++ b/program/templatetags/timeslots.py @@ -1,9 +1,9 @@ from django import template -register = template.Library() - from datetime import datetime, time, timedelta +register = template.Library() + @register.simple_tag def duration(start, end): diff --git a/program/urls.py b/program/urls.py index 18625a4..a3badf3 100644 --- a/program/urls.py +++ b/program/urls.py @@ -8,7 +8,6 @@ import os PROGRAM_SITE_MEDIA = os.path.join(os.path.dirname(__file__), '../site_media') - urlpatterns = patterns('', url(r'^today/?$', views.DayScheduleView.as_view()), url(r'^week/?$', views.WeekScheduleView.as_view()), @@ -25,5 +24,6 @@ urlpatterns = patterns('', url(r'^styles.css$', views.StylesView.as_view()) ) if settings.DEBUG: - urlpatterns += patterns('', - url(r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': PROGRAM_SITE_MEDIA})) + urlpatterns += \ + patterns('', + url(r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': PROGRAM_SITE_MEDIA})) diff --git a/program/views.py b/program/views.py index 5218ce7..bd04115 100644 --- a/program/views.py +++ b/program/views.py @@ -198,12 +198,18 @@ def json_day_schedule(request, year=None, month=None, day=None): timeslots = TimeSlot.objects.get_24h_timeslots(today) schedule = [] for ts in timeslots: - entry = { 'start': ts.start.strftime('%H:%M:%S'), 'title': ts.programslot.show.name, 'id': ts.programslot.show.id, 'automation-id': -1 } + entry = { + 'start': ts.start.strftime('%H:%M:%S'), + 'title': ts.programslot.show.name, + 'id': ts.programslot.show.id, + 'automation-id': -1 + } if ts.programslot.automation_id: entry['automation-id'] = ts.programslot.automation_id elif ts.programslot.show.automation_id: entry['automation-id'] = ts.programslot.show.automation_id - schedule.append(entry) + schedule.append(entry) - return HttpResponse(json.dumps(schedule, ensure_ascii=False, encoding='utf8').encode('utf8'), content_type="application/json; charset=utf-8") + return HttpResponse(json.dumps(schedule, ensure_ascii=False, encoding='utf8').encode('utf8'), + content_type="application/json; charset=utf-8") diff --git a/pv/urls.py b/pv/urls.py index ec1cdff..3c0ab4d 100644 --- a/pv/urls.py +++ b/pv/urls.py @@ -2,19 +2,20 @@ from django.conf import settings from django.conf.urls import patterns, url, include from django.contrib import admin -admin.autodiscover() - from program.views import json_day_schedule +admin.autodiscover() + urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^program/', include('program.urls')), url(r'^nop', include('nop.urls')), url(r'^tinymce/', include('tinymce.urls')), url(r'^export/day_schedule/(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/$', json_day_schedule) -) + ) if settings.DEBUG: urlpatterns += patterns('', - (r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}) -) + (r'^site_media/(?P.*)$', 'django.views.static.serve', + {'document_root': settings.MEDIA_ROOT}) + ) -- cgit v0.10.2 From 89a5671850ac13d13b6db7993eada9a7d06fba44 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 20 Apr 2016 14:58:20 +0200 Subject: merged hotfix (add end time to json day schedule, also include date in start/end) into master diff --git a/program/views.py b/program/views.py index bd04115..b4c2e8c 100644 --- a/program/views.py +++ b/program/views.py @@ -199,7 +199,8 @@ def json_day_schedule(request, year=None, month=None, day=None): schedule = [] for ts in timeslots: entry = { - 'start': ts.start.strftime('%H:%M:%S'), + '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, 'automation-id': -1 -- cgit v0.10.2 From 6f060bd60880726d6648ddaf2f5b2e7d5d73f4d9 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 21 May 2016 10:21:14 +0200 Subject: nop: added entries to musicprog list diff --git a/nop/views.py b/nop/views.py index 12e2ada..9fd87ee 100644 --- a/nop/views.py +++ b/nop/views.py @@ -20,7 +20,10 @@ MUSIKPROG_IDS = ( 204, # Radyo Mezopotamya 206, # Abunda Lingva 290, # styrian underground - 523 # Songbirds + 523, # Songbirds + 562, # Singing Birds + 563, # canzoni italiane + 564 # on connait la chanson ) SPECIAL_PROGRAM_IDS = ( -- cgit v0.10.2 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 From 30a62c57fbfbd6209f3ce91b7ca0670e65a08521 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 9b82779..e01467b 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 1ac4db5369b990d020d2ec59209952a641dedaf5 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Fri, 27 May 2016 20:56:38 +0200 Subject: show id diff --git a/program/models.py b/program/models.py index 7f9d665..97324b1 100644 --- a/program/models.py +++ b/program/models.py @@ -254,7 +254,7 @@ class Show(models.Model): verbose_name_plural = _("Shows") def __unicode__(self): - return u'%s' % self.name + return u'%04d | %s' % (self.id, self.name) def get_absolute_url(self): return reverse('show-detail', args=[self.slug]) -- cgit v0.10.2 From c27b374386463c56f41815869d6209f9a422b858 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 27 May 2016 22:02:16 +0200 Subject: reverted accidentially committed stuff diff --git a/program/views.py b/program/views.py index 23aab75..6a53e82 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) + queryset = Show.objects.filter(is_active=True).exclude(id=1).distinct() template_name = 'show_list.html' def get_queryset(self): @@ -50,7 +50,7 @@ class ShowListView(ListView): class ShowDetailView(DetailView): - queryset = Show.objects.exclude(id=1) + queryset = Show.objects.all().exclude(id=1) template_name = 'show_detail.html' -- cgit v0.10.2