summaryrefslogtreecommitdiffstats
path: root/item.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--item.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/item.py b/item.py
index c2accaa..c39a1ea 100644
--- a/item.py
+++ b/item.py
@@ -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