fix toString

This commit is contained in:
Robert Einsle 2017-02-04 12:39:28 +01:00
parent 7d4886abe2
commit bede78cf84

View File

@ -58,10 +58,10 @@ class Client(models.Model):
return self.accounting_for(2) return self.accounting_for(2)
def __str__(self): def __str__(self):
return str(self.uuid) return '{}, {}'.format(self.location.name, self.uuid)
def __unicode__(self): def __unicode__(self):
return str(self.client.location.name) return '{}, {}'.format(self.location.name, self.uuid)
class Accounting(models.Model): class Accounting(models.Model):
@ -72,10 +72,10 @@ class Accounting(models.Model):
prize = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True) prize = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True)
def __str__(self): def __str__(self):
return self.client.location.name return '{}: {} -> {}, {}'.format(self.client.uuid, self.time_from, self.time_to, self.prize)
def __unicode__(self): def __unicode__(self):
return self.client.location.name return '{}: {} -> {}, {}'.format(self.client.uuid, self.time_from, self.time_to, self.prize)
class Meta: class Meta:
ordering = ['-time_from'] ordering = ['-time_from']