summaryrefslogtreecommitdiffstats
path: root/item.py
diff options
context:
space:
mode:
Diffstat (limited to 'item.py')
-rw-r--r--item.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/item.py b/item.py
index b15fb8e..d1d8427 100644
--- a/item.py
+++ b/item.py
@@ -3,16 +3,20 @@
class item:
readOnly = ['id']
- def __init__(self, title=None, created=None, priority=None, description=None, row=None):
- if row == None:
+ def __init__(self, title=None, created=None, priority=None, description=None, completed=None, row=None):
+ if title != None:
self.__dict__['id'] = -1
self.title = title
self.created = created
self.priority = priority
self.description = description
+ self.completed = completed
else:
- self.__init__(row[1], row[2], row[3], row[4])
- self.__dict__['id'] = row[0]
+ id = row[0]
+
+ row.__delitem__(0)
+ apply(self.__init__, row)
+ self.__dict__['id'] = id
def setId(self, id):
if self.id == -1:
@@ -33,6 +37,9 @@ class item:
def getDescription(self):
return self.description
+ def getCompleted(self):
+ return self.completed
+
def __setattr__(self, name, value):
if name not in item.readOnly:
if name not in self.__dict__ or self.__dict__[name] != value: