aboutsummaryrefslogtreecommitdiff
path: root/src/db/tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/tasks.py')
-rw-r--r--src/db/tasks.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/db/tasks.py b/src/db/tasks.py
index 29d3ba6..b72965b 100644
--- a/src/db/tasks.py
+++ b/src/db/tasks.py
@@ -1,9 +1,10 @@
from sqlite3 import Cursor
import time
+from typing import List
from model.task import Task, ValidTaskForm
-def get(cursor: Cursor) -> Task:
+def get(cursor: Cursor) -> List[Task]:
cursor.execute(
" SELECT"
" id,"
@@ -11,7 +12,6 @@ def get(cursor: Cursor) -> Task:
" updated_at,"
" name,"
" duration,"
- " tag,"
" difficulty,"
" priority,"
" description"
@@ -26,10 +26,9 @@ def get(cursor: Cursor) -> Task:
updated_at = task[2],
name = task[3],
duration = task[4],
- tag = task[5],
- difficulty = task[6],
- priority = task[7],
- description = task[8]
+ difficulty = task[5],
+ priority = task[6],
+ description = task[7]
))
return res
@@ -42,12 +41,11 @@ def insert(cursor: Cursor, form: ValidTaskForm):
" updated_at,"
" name,"
" duration,"
- " tag,"
" difficulty,"
" priority,"
" description"
- " ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
- (now, now, form.name, form.duration, form.tag, int(form.difficulty), int(form.priority), form.description))
+ " ) VALUES (?, ?, ?, ?, ?, ?, ?)",
+ (now, now, form.name, form.duration, int(form.difficulty), int(form.priority), form.description))
return Task(
id = cursor.lastrowid,
@@ -55,7 +53,6 @@ def insert(cursor: Cursor, form: ValidTaskForm):
updated_at = now,
name = form.name,
duration = form.duration,
- tag = form.tag,
difficulty = form.difficulty,
priority = form.priority,
description = form.description
@@ -69,12 +66,11 @@ def update(cursor: Cursor, task: Task, form: ValidTaskForm):
" updated_at = ?,"
" name = ?,"
" duration = ?,"
- " tag = ?,"
" difficulty = ?,"
" priority = ?,"
" description = ?"
" WHERE id = ?",
- (now, form.name, form.duration, form.tag, int(form.difficulty), int(form.priority), form.description, task.id))
+ (now, form.name, form.duration, int(form.difficulty), int(form.priority), form.description, task.id))
return Task(
id = task.id,
@@ -82,7 +78,6 @@ def update(cursor: Cursor, task: Task, form: ValidTaskForm):
updated_at = now,
name = form.name,
duration = form.duration,
- tag = form.tag,
difficulty = form.difficulty,
priority = form.priority,
description = form.description