aboutsummaryrefslogtreecommitdiff
path: root/budget/models.py
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-09-13 11:27:36 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2011-09-13 11:27:36 +0200
commitd2e2260e522cf4b7de24dbb2adbb3bfb12ee01f3 (patch)
treedc3caed10008f20e98973b2ad539b25cb2ee46d7 /budget/models.py
parentef3d761fc70c1c2bf0d45dde6d2703c73715bf6c (diff)
downloadihatemoney-mirror-d2e2260e522cf4b7de24dbb2adbb3bfb12ee01f3.zip
ihatemoney-mirror-d2e2260e522cf4b7de24dbb2adbb3bfb12ee01f3.tar.gz
ihatemoney-mirror-d2e2260e522cf4b7de24dbb2adbb3bfb12ee01f3.tar.bz2
Add a serialization mechanism
Diffstat (limited to 'budget/models.py')
-rw-r--r--budget/models.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/budget/models.py b/budget/models.py
index 8feaccb..8d68746 100644
--- a/budget/models.py
+++ b/budget/models.py
@@ -7,6 +7,10 @@ db = SQLAlchemy()
# define models
class Project(db.Model):
+
+ _to_serialize = ("id", "name", "password", "contact_email",
+ "members", "active_members")
+
id = db.Column(db.String, primary_key=True)
name = db.Column(db.UnicodeText)
@@ -68,6 +72,9 @@ class Project(db.Model):
class Person(db.Model):
+
+ _to_serialize = ("id", "name", "activated")
+
id = db.Column(db.Integer, primary_key=True)
project_id = db.Column(db.Integer, db.ForeignKey("project.id"))
bills = db.relationship("Bill", backref="payer")