aboutsummaryrefslogtreecommitdiff
path: root/src/service
diff options
context:
space:
mode:
authorJoris2020-06-06 17:44:26 +0200
committerJoris2020-06-06 19:54:03 +0200
commit1595e0de940a86a7810df0e02e43838d97c0d846 (patch)
tree9701eeec0d98baa9f6044b1911df68e4c8539819 /src/service
parent6b9195000eb5404c247288b384d7ca2bacc1ab23 (diff)
Provide nix build
Diffstat (limited to 'src/service')
-rw-r--r--src/service/tasks.py32
1 files changed, 0 insertions, 32 deletions
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()