summaryrefslogtreecommitdiffstats
path: root/item.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--item.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/item.py b/item.py
new file mode 100644
index 0000000..c2accaa
--- /dev/null
+++ b/item.py
@@ -0,0 +1,29 @@
+class item:
+ readOnly = ['id']
+
+ def __init__(self, title, created, priority):
+ self.id = -1
+ self.title = title
+ self.created = created
+ self.priority = priority
+
+ def setId(self, id):
+ if self.id == -1:
+ self.id = id
+
+ def getTitle(self):
+ return self.title
+
+ def getCreatedAt(self):
+ return self.created
+
+ def getPriority(self):
+ return self.priority
+
+ def __setattr__(self, name, value):
+ if name not in item.readOnly:
+ if name not in self.__dict__ or self.__dict__[name] != value:
+ self.__dict__[name] = value
+
+ if 'observer' in self.__dict__:
+ self.observer.notifyChange(self)