diff --git a/nerdshope/models.py b/nerdshope/models.py index 160dfc3..972f1f8 100644 --- a/nerdshope/models.py +++ b/nerdshope/models.py @@ -7,7 +7,7 @@ class BankAccount(models.Model): physical=models.CharField(max_length=100) currency=models.CharField(max_length=5) @property - def balance(self): return sum(map(Payment.objects.filter(account=self))) + def balance(self): return sum(map(lambda x:x.amount,Payment.objects.filter(account=self))) def __str__(self): return str(self.name)+', '+str(self.balance)