diff options
author | Christian Pointner <equinox@helsinki.at> | 2017-04-27 14:03:18 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2017-04-27 14:03:18 (GMT) |
commit | c495fb5ee4475145c63392cf52dbe38c047e134d (patch) | |
tree | b2fb8b3409edccfde2def7291d69d1d6fa597af9 | |
parent | 38eff6e23ec2080fd6bbda3aea016657f59d29f6 (diff) |
move musikprogram handling of nop to settings
-rw-r--r-- | nop/views.py | 27 | ||||
-rw-r--r-- | pv/settings.py | 5 |
2 files changed, 9 insertions, 23 deletions
diff --git a/nop/views.py b/nop/views.py index d00eea5..21b23ec 100644 --- a/nop/views.py +++ b/nop/views.py @@ -1,5 +1,6 @@ # coding=utf-8 +from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.shortcuts import render_to_response from django.http import HttpResponse @@ -13,26 +14,6 @@ from datetime import datetime DB = 'nop' -MUSIKPROG_IDS = ( - 1, # unmodieriertes musikprogramm - 17, # bumbumtschak - 203, # Hotel Passage - 204, # Radyo Mezopotamya - 206, # Abunda Lingva - 290, # styrian underground - 523, # Songbirds - 562, # Singing Birds - 563, # canzoni italiane - 564, # on connait la chanson - 604 # pussy*whipped -) - -SPECIAL_PROGRAM_IDS = ( - 66, # Probebühne - 374 # musikprogramm bunt gemischt -) - - class NopForm(forms.Form): date = forms.DateField( required=True, @@ -88,8 +69,8 @@ def _current(): album = None show = _get_show() - if show['id'] in MUSIKPROG_IDS \ - or (show['id'] in SPECIAL_PROGRAM_IDS and not show['note']): + if show['id'] in settings.MUSIKPROG_IDS \ + or (show['id'] in settings.SPECIAL_PROGRAM_IDS and not show['note']): result = _which().objects.using(DB).filter(carttype__exact='pool')[0] artist = result.artist title = result.title @@ -105,7 +86,7 @@ def _current(): def _bydate(year=None, month=None, day=None, hour=None, minute=None): show = _get_show(datetime(year, month, day, hour, minute)) - if show['id'] and show['id'] not in MUSIKPROG_IDS: + if show['id'] and show['id'] not in settings.MUSIKPROG_IDS: return [{'show': show['name'], 'start': show['start'], 'artist': None, diff --git a/pv/settings.py b/pv/settings.py index e967b39..96230e4 100644 --- a/pv/settings.py +++ b/pv/settings.py @@ -97,6 +97,11 @@ TINYMCE_DEFAULT_CONFIG = { CACHE_BACKEND = 'locmem://' +MUSIKPROG_IDS = ( + 1, # unmodieriertes musikprogramm +) +SPECIAL_PROGRAM_IDS = () + try: from local_settings import * except ImportError: |