Task

class knut.services.task.Task(uid=None, task_dir=None)

Create and manipulate a task.

Provide a task object. The task can have a due date and time with a reminder in seconds before the due. When the reminder is due, the event on_remind() is called. Objects registered to this event can react upon the notification and send e.g. a reminder to clients.

Create a task with the uid and save it in the task_dir. If the uid is None, a new unique identifier is assigned to the task.

assignee = None

The user to which the task is assigned.

author = None

The name of the task author.

delete_task()

Delete the task.

description = None

The description text of the task.

done = None

Whether the task is done or not.

due = None

The due date time of the task in seconds since the epoch January 1, 1970, 00:00:00 (UTC).

reminder = None

The time in seconds before due. When the time is reached, a reminder notification is send.

task()

Return the task as dictionary.

The dictionary has the keys 'assignee', 'author', 'description', 'done', 'due', 'reminder', 'title' and 'id'

task_dir = None

The directory where the task can be saved.

title = None

The task title.

uid = None

The unique identifier of the task.

update_task(task)

Update the task to the parsed task dictionary.