diff options
author | Joris | 2020-06-06 09:07:42 +0200 |
---|---|---|
committer | Joris | 2020-06-06 09:07:42 +0200 |
commit | b244640288648f27ce1fc7be3f175703e0a3412b (patch) | |
tree | db0221e72626461837c5c30080454c1fb954a8a0 /src/db | |
parent | 3844f76d18e376777ca4d7c124df6d6b4896a361 (diff) |
Add menu options to update tasks status
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/tasks.py | 8 |
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) |