aboutsummaryrefslogtreecommitdiff
path: root/budget/models.py
diff options
context:
space:
mode:
authorJocelyn Delande <jocelyn@crapouillou.net>2015-08-20 11:11:09 +0200
committerJocelyn Delande <jocelyn@crapouillou.net>2016-06-15 10:20:37 +0200
commit06f10d050814e026ebac3ddedd2bec2d5d616eca (patch)
treefc7e31f3995c8ba6dc85e605d6fe7469738a2e9d /budget/models.py
parent2b071a1a3bc752bfaa0fd6c0b2d8f8460721d6d8 (diff)
downloadihatemoney-mirror-06f10d050814e026ebac3ddedd2bec2d5d616eca.zip
ihatemoney-mirror-06f10d050814e026ebac3ddedd2bec2d5d616eca.tar.gz
ihatemoney-mirror-06f10d050814e026ebac3ddedd2bec2d5d616eca.tar.bz2
Added member weights support to API
Diffstat (limited to 'budget/models.py')
-rw-r--r--budget/models.py4
1 files changed, 2 insertions, 2 deletions
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)