summaryrefslogtreecommitdiff
path: root/model.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-05-10 21:40:26 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-05-10 21:40:26 +0200
commit7b1b6578bd3f1fbb5f23fb0cb907229a8feb477d (patch)
tree214fc7e880102a09902e6cbb169785bca0a62d70 /model.py
parente715c36c2b6047f30407412cc1af6b6afb12fd59 (diff)
downloadkosten-7b1b6578bd3f1fbb5f23fb0cb907229a8feb477d.tar.gz
kosten-7b1b6578bd3f1fbb5f23fb0cb907229a8feb477d.tar.bz2
kosten-7b1b6578bd3f1fbb5f23fb0cb907229a8feb477d.zip
Added the 'add expense' stuff
Diffstat (limited to '')
-rw-r--r--model.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/model.py b/model.py
index fe863b9..2a16bde 100644
--- a/model.py
+++ b/model.py
@@ -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)