aboutsummaryrefslogtreecommitdiff
path: root/budget/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'budget/models.py')
-rw-r--r--budget/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/budget/models.py b/budget/models.py
index 852b3e1..88d44ae 100644
--- a/budget/models.py
+++ b/budget/models.py
@@ -37,7 +37,7 @@ class Project(db.Model):
# for each person
for person in self.members:
# get the list of bills he has to pay
- bills = Bill.query.filter(Bill.owers.contains(person))
+ bills = Bill.query.options(orm.subqueryload(Bill.owers)).filter(Bill.owers.contains(person))
for bill in bills.all():
if person != bill.payer:
share = bill.pay_each() * person.weight