From 06f10d050814e026ebac3ddedd2bec2d5d616eca Mon Sep 17 00:00:00 2001 From: Jocelyn Delande Date: Thu, 20 Aug 2015 11:11:09 +0200 Subject: Added member weights support to API --- budget/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'budget/models.py') diff --git a/budget/models.py b/budget/models.py index 16cc6c1..afd29f1 100644 --- a/budget/models.py +++ b/budget/models.py @@ -153,7 +153,7 @@ class Person(db.Model): query_class = PersonQuery - _to_serialize = ("id", "name", "activated") + _to_serialize = ("id", "name", "weight", "activated") id = db.Column(db.Integer, primary_key=True) project_id = db.Column(db.String(64), db.ForeignKey("project.id")) @@ -219,7 +219,7 @@ class Bill(db.Model): archive = db.Column(db.Integer, db.ForeignKey("archive.id")) def pay_each(self): - """Compute what each person has to pay""" + """Compute what each share has to pay""" if self.owers: # FIXME: SQL might dot that more efficiently return self.amount / sum(i.weight for i in self.owers) -- cgit v1.1