aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
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)