summaryrefslogtreecommitdiffstats
path: root/item.py
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2009-06-23 04:28:43 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2009-06-23 04:28:43 +0200
commita5c1c9260fb01204112f8b8868170d15dd05019c (patch)
tree7ffd606a19f0fbb2b5bf5682b28e025658696c35 /item.py
parente1b6d1a619aa8f75510d5b1812fe68459fb01578 (diff)
downloadtodolist-a5c1c9260fb01204112f8b8868170d15dd05019c.tar.gz
todolist-a5c1c9260fb01204112f8b8868170d15dd05019c.tar.xz
todolist-a5c1c9260fb01204112f8b8868170d15dd05019c.zip
added priorities with possibility to define different colors
colors does not work correctly
Diffstat (limited to 'item.py')
-rw-r--r--item.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/item.py b/item.py
index 99abb7b..c39bd56 100644
--- a/item.py
+++ b/item.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import time
+from priority import Priorities
class item:
readOnly = ['id']
@@ -10,7 +11,7 @@ class item:
if title != None:
self.title = title
self.created = created
- self.priority = priority
+ self.setPriority(priority)
self.description = description
self.completed = completed
self.removed = removed
@@ -58,6 +59,14 @@ class item:
def getDue(self):
return self.due
+ def setPriority(self, id=None, name=None):
+ if id is not None:
+ self.priority = Priorities().getPriority(id = id)
+ elif name is not None:
+ self.priority = Priorities().getPriority(name = name)
+ else:
+ self.priority = None
+
def __setattr__(self, name, value):
if name not in item.readOnly:
if name not in self.__dict__ or self.__dict__[name] != value: