summaryrefslogtreecommitdiff
path: root/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'model.py')
-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)