Fix all pep8 and eslint errors :0

This commit is contained in:
Jan Tuomi
2017-05-21 16:28:47 +03:00
parent 4ab9c98b57
commit a2fb923220
32 changed files with 306 additions and 376 deletions
+17 -9
View File
@@ -1,11 +1,13 @@
from datetime import datetime
from django.db import models
from django import forms
from django.utils import timezone
from datetime import datetime
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _
class InfoItem(models.Model):
class __meta__:
@@ -73,27 +75,30 @@ class InfoItem(models.Model):
class ABBInfoItem(InfoItem):
display_name = _("ABB jobs")
def get_template_url(self):
return "/static/html/abb.html"
@staticmethod
def get_create_template_url():
return "/static/html/abb_create.html"
class ApyInfoItem(InfoItem):
display_name = _("APY Item")
def get_template_url(self):
return "/static/html/apy.html"
@staticmethod
def get_create_template_url():
return "/static/html/apy_create.html"
class ExternalWebsiteInfoItem(InfoItem):
display_name = _("External website")
url = models.TextField()
def get_template_url(self):
return "/static/html/external_website.html?url={}".format(self.name)
@@ -114,8 +119,8 @@ class ExternalWebsiteInfoItem(InfoItem):
def get_list(self):
return {
'id':self.id,
'name':self.name,
'id': self.id,
'name': self.name,
'url': self.url,
}
@@ -137,8 +142,10 @@ class ExternalWebsiteInfoItem(InfoItem):
pass
self.save()
class SossoInfoItem(InfoItem):
display_name = _("Sössö articles")
def get_template_url(self):
return "/static/html/sosso.html"
@@ -146,6 +153,7 @@ class SossoInfoItem(InfoItem):
def get_create_template_url():
return "/static/html/sosso_create.html"
class EventInfoItem(InfoItem):
display_name = _("Events")
@@ -157,7 +165,6 @@ class EventInfoItem(InfoItem):
return "/static/html/events_create.html"
class ImageInfoItem(InfoItem):
display_name = _("Image")
img = models.ImageField(upload_to="infoimages/")
@@ -178,6 +185,7 @@ class ImageInfoItem(InfoItem):
class HslInfoItem(InfoItem):
display_name = _("HSL timetables")
def get_template_url(self):
return "/static/html/hsl.html"
@@ -275,15 +283,15 @@ class Rotation(models.Model):
instance_list = list(map(lambda i: i.get_dict(), filtered))
return {
'id':self.id,
'id': self.id,
'name': self.name,
'instances': instance_list,
}
def get_list(self):
return {
'id':self.id,
'name':self.name,
'id': self.id,
'name': self.name,
}
def __str__(self):