From c495fb5ee4475145c63392cf52dbe38c047e134d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 27 Apr 2017 16:03:18 +0200 Subject: move musikprogram handling of nop to settings 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: -- cgit v0.10.2 From dbefa4de1d180a92bdcf591cb234c74970421e45 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 27 Apr 2017 16:16:12 +0200 Subject: set correct file encoding diff --git a/nop/views.py b/nop/views.py index 21b23ec..4c29829 100644 --- a/nop/views.py +++ b/nop/views.py @@ -1,4 +1,4 @@ -# coding=utf-8 +# -*- coding: utf-8 -*- from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned diff --git a/pv/settings.py b/pv/settings.py index 96230e4..47b9d2e 100644 --- a/pv/settings.py +++ b/pv/settings.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Django settings for pv project. import os.path -- cgit v0.10.2