aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorJoris2020-06-06 09:07:42 +0200
committerJoris2020-06-06 09:07:42 +0200
commitb244640288648f27ce1fc7be3f175703e0a3412b (patch)
treedb0221e72626461837c5c30080454c1fb954a8a0 /src/db
parent3844f76d18e376777ca4d7c124df6d6b4896a361 (diff)
downloadtodo-b244640288648f27ce1fc7be3f175703e0a3412b.tar.gz
todo-b244640288648f27ce1fc7be3f175703e0a3412b.tar.bz2
todo-b244640288648f27ce1fc7be3f175703e0a3412b.zip
Add menu options to update tasks status
Diffstat (limited to 'src/db')
-rw-r--r--src/db/tasks.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/db/tasks.py b/src/db/tasks.py
index dca7710..efb88d6 100644
--- a/src/db/tasks.py
+++ b/src/db/tasks.py
@@ -90,8 +90,14 @@ def update(cursor: Cursor, task: Task, form: ValidTaskForm):
description = form.description
)
-def delete(cursor: Cursor, ids):
+def delete(cursor: Cursor, ids: List[int]):
if len(ids) >= 1:
cursor.execute(
"DELETE FROM tasks WHERE id IN (%s)" % ",".join("?"*len(ids)),
ids)
+
+def update_status(cursor: Cursor, ids: List[int], s: Status):
+ if len(ids) >= 1:
+ cursor.execute(
+ "UPDATE tasks SET status = ? WHERE id IN (%s)" % ",".join("?"*len(ids)),
+ [status.format(s)] + ids)