Commit 9829b995 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add accessors for creation date and completion date.

parent c8ddc54d
...@@ -149,6 +149,13 @@ class TodoBase(object): ...@@ -149,6 +149,13 @@ class TodoBase(object):
""" Returns True iff this todo has been completed. """ """ Returns True iff this todo has been completed. """
return self.fields['completed'] return self.fields['completed']
def completion_date(self):
"""
Returns the completion date when the todo has been completed, or None
otherwise.
"""
return self.fields['completionDate']
def set_completed(self): def set_completed(self):
""" """
Marks the todo as complete. Marks the todo as complete.
...@@ -164,6 +171,10 @@ class TodoBase(object): ...@@ -164,6 +171,10 @@ class TodoBase(object):
self.src = re.sub(r'^(\([A-Z]\) )?', \ self.src = re.sub(r'^(\([A-Z]\) )?', \
'x ' + today.isoformat() + ' ', self.src) 'x ' + today.isoformat() + ' ', self.src)
def creation_date(self):
""" Returns the creation date of a todo. """
return self.fields['creationDate']
def __str__(self): def __str__(self):
""" A printer for the todo item. """ """ A printer for the todo item. """
return self.source() return self.source()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment