summaryrefslogtreecommitdiff
path: root/nop
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2017-04-27 14:03:18 (GMT)
committerChristian Pointner <equinox@helsinki.at>2017-04-27 14:03:18 (GMT)
commitc495fb5ee4475145c63392cf52dbe38c047e134d (patch)
treeb2fb8b3409edccfde2def7291d69d1d6fa597af9 /nop
parent38eff6e23ec2080fd6bbda3aea016657f59d29f6 (diff)
move musikprogram handling of nop to settings
Diffstat (limited to 'nop')
-rw-r--r--nop/views.py27
1 files changed, 4 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,