diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2010-05-10 21:40:26 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2010-05-10 21:40:26 +0200 |
commit | 7b1b6578bd3f1fbb5f23fb0cb907229a8feb477d (patch) | |
tree | 214fc7e880102a09902e6cbb169785bca0a62d70 /model.py | |
parent | e715c36c2b6047f30407412cc1af6b6afb12fd59 (diff) | |
download | kosten-7b1b6578bd3f1fbb5f23fb0cb907229a8feb477d.tar.gz kosten-7b1b6578bd3f1fbb5f23fb0cb907229a8feb477d.tar.bz2 kosten-7b1b6578bd3f1fbb5f23fb0cb907229a8feb477d.zip |
Added the 'add expense' stuff
Diffstat (limited to 'model.py')
-rw-r--r-- | model.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -33,7 +33,6 @@ class Entity (elixir.Entity): # class Category (Entity): - name = Field(T.String(50), unique = True) parent = ManyToOne('Category') @@ -65,6 +64,16 @@ class SingleExpense (Expense): return cls.query.filter(comp) + @property + def date (self): + return datetime.date(self.year, self.month, self.day) + + @date.setter + def date (self, d): + self.year = d.year + self.month = d.month + self.day = d.day + class ConstExpense (Expense): months = ReqField(T.SmallInteger) start = ReqField(T.Date, index = True) |