summaryrefslogtreecommitdiff
path: root/nop
diff options
context:
space:
mode:
authorErnesto Rico Schmidt <ernesto@ontolabs.com>2020-09-09 20:53:27 (GMT)
committerErnesto Rico Schmidt <ernesto@ontolabs.com>2020-09-09 20:53:27 (GMT)
commit45c7b5cd9b2c2d4c987372f391b6cc7d1922ae10 (patch)
treedd330f0d2770ef4c2e12dab4f607bfe7de274a23 /nop
parent5fbe01893c6cbc92eb77eccecb3a9eae65df5aa1 (diff)
Optimize imports. Format
Diffstat (limited to 'nop')
-rw-r--r--nop/urls.py6
-rw-r--r--nop/views.py18
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]