diff options
Diffstat (limited to '')
-rw-r--r-- | item.py | 23 |
1 files changed, 16 insertions, 7 deletions
@@ -1,16 +1,25 @@ +# -*- coding: utf-8 -*- + class item: readOnly = ['id'] - def __init__(self, title, created, priority): - self.id = -1 - self.title = title - self.created = created - self.priority = priority + def __init__(self, title=None, created=None, priority=None, row=None): + if row == None: + self.__dict__['id'] = -1 + self.title = title + self.created = created + self.priority = priority + else: + self.__init__(row[1], row[2], row[3]) + self.__dict__['id'] = row[0] def setId(self, id): if self.id == -1: - self.id = id - + self.__dict__['id'] = id + + def getId(self): + return self.id + def getTitle(self): return self.title |