aboutsummaryrefslogtreecommitdiff
path: root/src/db/tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/tasks.py')
-rw-r--r--src/db/tasks.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/db/tasks.py b/src/db/tasks.py
index d03877b..e22a315 100644
--- a/src/db/tasks.py
+++ b/src/db/tasks.py
@@ -10,6 +10,7 @@ def get(cursor: Cursor) -> Task:
" created_at,"
" modified_at,"
" name,"
+ " description,"
" duration,"
" tag"
" FROM tasks")
@@ -22,8 +23,9 @@ def get(cursor: Cursor) -> Task:
created_at = task[1],
modified_at = task[2],
name = task[3],
- duration = task[4],
- tag = task[5]
+ description = task[4],
+ duration = task[5],
+ tag = task[6]
))
return res
@@ -35,16 +37,18 @@ def insert(cursor: Cursor, form: ValidTaskForm):
" created_at,"
" modified_at,"
" name,"
+ " description,"
" duration,"
" tag"
- " ) VALUES (?, ?, ?, ?, ?)",
- (now, now, form.name, form.duration, form.tag))
+ " ) VALUES (?, ?, ?, ?, ?, ?)",
+ (now, now, form.name, form.description, form.duration, form.tag))
return Task(
id = cursor.lastrowid,
created_at = now,
modified_at = now,
name = form.name,
+ description = form.description,
duration = form.duration,
tag = form.tag
)
@@ -57,16 +61,18 @@ def update(cursor: Cursor, task: Task, form: ValidTaskForm):
" SET"
" modified_at = ?,"
" name = ?,"
+ " description = ?,"
" duration = ?,"
" tag = ?"
" WHERE id = ?",
- (now, form.name, form.duration, form.tag, task.id))
+ (now, form.name, form.description, form.duration, form.tag, task.id))
return Task(
id = task.id,
created_at = task.created_at,
modified_at = now,
name = form.name,
+ description = form.description,
duration = form.duration,
tag = form.tag
)