From 1595e0de940a86a7810df0e02e43838d97c0d846 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 6 Jun 2020 17:44:26 +0200 Subject: Provide nix build --- src/service/tasks.py | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/service/tasks.py (limited to 'src/service') diff --git a/src/service/tasks.py b/src/service/tasks.py deleted file mode 100644 index 87194c4..0000000 --- a/src/service/tasks.py +++ /dev/null @@ -1,32 +0,0 @@ -from typing import List - -from model.task import Task, ValidTaskForm -from model.status import Status -import db.tasks -import db.task_tags -import database - -def get(cursor, status: Status) -> List[Task]: - return db.tasks.get(cursor, status) - -def create(cursor, status: Status, task_form: ValidTaskForm) -> Task: - task = db.tasks.insert(cursor, status, task_form) - db.task_tags.insert_many(cursor, task.id, task_form.tags) - database.commit() - return task - -def update(cursor, task: Task, task_form: ValidTaskForm) -> Task: - db.task_tags.delete(cursor, [task.id]) - updated_task = db.tasks.update(cursor, task, task_form) - db.task_tags.insert_many(cursor, task.id, task_form.tags) - database.commit() - return updated_task - -def delete(cursor, task_ids: List[int]): - db.task_tags.delete(cursor, task_ids) - db.tasks.delete(cursor, task_ids) - database.commit() - -def update_status(cursor, task_ids: List[int], status: Status) -> List[Task]: - db.tasks.update_status(cursor, task_ids, status) - database.commit() -- cgit v1.2.3