diff options
Diffstat (limited to '')
-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) |