diff --git a/billard/models.py b/billard/models.py index 3f8054a..9f7dd07 100644 --- a/billard/models.py +++ b/billard/models.py @@ -49,7 +49,7 @@ class Client(models.Model): desk2_prize_ht = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True) def accounting_for(self, desk_no): - return Accounting.objects.filter(location=self.location, client_id=self.id, desk_no=desk_no)[:2][::-1] + return Accounting.objects.filter(client_id=self.id, desk_no=desk_no)[:2][::-1] def accounting_1(self): return self.accounting_for(1) @@ -61,7 +61,7 @@ class Client(models.Model): return str(self.uuid) def __unicode__(self): - return str(self.location.name) + return str(self.client.location.name) 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) def __str__(self): - return self.location.name + return self.client.location.name def __unicode__(self): - return self.location.name + return self.client.location.name class Meta: ordering = ['-time_from']