diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2011-09-09 19:14:19 +0200 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2011-09-09 19:14:19 +0200 |
| commit | 801802836a648ac0865c1c932e3cf9a01e3a639e (patch) | |
| tree | d2ee3ed47d6c3fe7c454ef00c6018a633660d9d7 /budget/models.py | |
| parent | 295beeade4e2238b7290940a348fe3a691336e38 (diff) | |
| download | ihatemoney-mirror-801802836a648ac0865c1c932e3cf9a01e3a639e.zip ihatemoney-mirror-801802836a648ac0865c1c932e3cf9a01e3a639e.tar.gz ihatemoney-mirror-801802836a648ac0865c1c932e3cf9a01e3a639e.tar.bz2 | |
Start working on archive management
Diffstat (limited to 'budget/models.py')
| -rw-r--r-- | budget/models.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/budget/models.py b/budget/models.py index ab93548..08e46ae 100644 --- a/budget/models.py +++ b/budget/models.py @@ -78,6 +78,8 @@ class Bill(db.Model): date = db.Column(db.Date, default=datetime.now) what = db.Column(db.UnicodeText) + archive = db.Column(db.Integer, db.ForeignKey("archive.id")) + def pay_each(self): """Compute what each person has to pay""" return round(self.amount / len(self.owers), 2) @@ -87,3 +89,18 @@ class Bill(db.Model): self.payer, ", ".join([o.name for o in self.owers])) +class Archive(db.Model): + id = db.Column(db.Integer, primary_key=True) + project_id = db.Column(db.Integer, db.ForeignKey("project.id")) + name = db.Column(db.UnicodeText) + + @property + def start_date(self): + pass + + @property + def end_date(self): + pass + + def __repr__(self): + return "<Archive>" |
