summaryrefslogtreecommitdiffstats
path: root/itemList.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2009-05-10 19:40:47 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2009-05-10 19:40:47 +0200
commit4bc9b503fa6070e491062d35967d20b37e9c94e0 (patch)
tree9d0d647a4a006db8adf18240418f72b80b4bd0bd /itemList.py
parent91e7bba27adccc2d9815afed104b678366ecb62a (diff)
downloadtodolist-4bc9b503fa6070e491062d35967d20b37e9c94e0.tar.gz
todolist-4bc9b503fa6070e491062d35967d20b37e9c94e0.tar.xz
todolist-4bc9b503fa6070e491062d35967d20b37e9c94e0.zip
add/remove support
change db layout to version 0.4, with removed column only display items, that are not removed created events for add, remove buttons remove, __delitem__, contains in itemList as proxy to itemList.data added default constructor (if nothing is set) for item to create a new
Diffstat (limited to 'itemList.py')
-rw-r--r--itemList.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/itemList.py b/itemList.py
index 6252946..7dc2944 100644
--- a/itemList.py
+++ b/itemList.py
@@ -14,6 +14,17 @@ class itemList:
def __setitem__(self, idx, item):
self.data[idx] = item
+ def __delitem__(self, key):
+ self.date[key].removed = True
+ self.data.__delitem__(key)
+
+ def remove(self, item):
+ item.removed = True
+ self.data.remove(item)
+
+ def __contians__(self, item):
+ return (item in self.data)
+
def append(self, item):
item.observer = self
self.data.append(item)