Fixed model representations for Gameservers.

This commit is contained in:
A. Svensson 2015-02-18 17:51:44 +01:00
parent b3877c3518
commit a3e0bbf7e7

View File

@ -6,7 +6,10 @@ class Server(models.Model):
site_url = models.URLField(blank=True) site_url = models.URLField(blank=True)
class Meta: class Meta:
ordering = ['-title'] ordering = ['title']
def __str__(self):
return self.title
class Population(models.Model): class Population(models.Model):
timestamp = models.DateTimeField(auto_now_add=True) timestamp = models.DateTimeField(auto_now_add=True)
@ -16,3 +19,6 @@ class Population(models.Model):
class Meta: class Meta:
ordering = ['-timestamp', 'server'] ordering = ['-timestamp', 'server']
def __str__(self):
return '{} {}'.format(self.timestamp, self.server.title)