diff options
-rw-r--r-- | nop/urls.py | 6 | ||||
-rw-r--r-- | nop/views.py | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/nop/urls.py b/nop/urls.py index 936af7a..4953e97 100644 --- a/nop/urls.py +++ b/nop/urls.py @@ -1,9 +1,9 @@ +import os + from django.conf.urls import url from django.views.static import serve -from views import get, get_current, nop_form - -import os +from .views import get, get_current, nop_form NOP_SITE_MEDIA = os.path.join(os.path.dirname(__file__), 'site_media') diff --git a/nop/views.py b/nop/views.py index 4c29829..93b16ab 100644 --- a/nop/views.py +++ b/nop/views.py @@ -1,19 +1,19 @@ -# -*- coding: utf-8 -*- +import json +import time +from datetime import datetime +from django import forms from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned -from django.shortcuts import render_to_response from django.http import HttpResponse -from django import forms -from models import Master, Standby, State -from program.models import TimeSlot +from django.shortcuts import render_to_response -import json -import time -from datetime import datetime +from program.models import TimeSlot +from .models import Master, Standby, State DB = 'nop' + class NopForm(forms.Form): date = forms.DateField( required=True, @@ -97,7 +97,7 @@ def _bydate(year=None, month=None, day=None, hour=None, minute=None): int(minute), 0, 0, 0, -1))) * 1000000 result = _which(ts).objects.using(DB).filter(carttype__exact='pool').filter(timestamp__lt=ts)[:5] return [{'show': show['name'], - 'start': _dtstring(time.localtime(item.timestamp//1000000)), + 'start': _dtstring(time.localtime(item.timestamp // 1000000)), 'artist': item.artist, 'title': item.title, 'album': item.album} for item in result] |