Merge branch 'master' into private_servers

This commit is contained in:
A. Svensson 2015-04-06 02:56:31 +02:00
commit 5fc67d27d2
2 changed files with 6 additions and 2 deletions

View File

@ -1,9 +1,11 @@
from __future__ import unicode_literals
from datetime import timedelta from datetime import timedelta
from ast import literal_eval from ast import literal_eval
from django.db import models from django.db import models
from django.utils import timezone from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
DAY_NAMES = [ DAY_NAMES = [
@ -17,6 +19,7 @@ DAY_NAMES = [
] ]
@python_2_unicode_compatible
class Server(models.Model): class Server(models.Model):
title = models.CharField(max_length=255) title = models.CharField(max_length=255)
game_url = models.CharField(max_length=255) game_url = models.CharField(max_length=255)
@ -100,6 +103,7 @@ class Server(models.Model):
tmp = [0,0,0,0,0,0,0] tmp = [0,0,0,0,0,0,0]
return zip(DAY_NAMES, tmp) return zip(DAY_NAMES, tmp)
@python_2_unicode_compatible
class ServerHistory(models.Model): class ServerHistory(models.Model):
server = models.ForeignKey(Server) server = models.ForeignKey(Server)
created = models.DateTimeField(default=timezone.now) created = models.DateTimeField(default=timezone.now)
@ -109,5 +113,5 @@ class ServerHistory(models.Model):
ordering = ['-created', 'server'] ordering = ['-created', 'server']
def __str__(self): def __str__(self):
return 'History for {} at {}.'.format(self.server, self.created) return 'History for {} at {}.'.format(self.server.title, self.created)

View File

@ -45,7 +45,7 @@
<span class="right"> <span class="right">
Source code at Source code at
<a href="https://github.com/lmas/ss13_hub">Github</a>. <a href="https://github.com/lmas/ss13_se">Github</a>.
</span> </span>
</p> </p>
</footer> </footer>