From 0f1610333324d58acafee8c0fa9d9c9bc293b219 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 31 May 2020 13:59:35 +0200 Subject: Use defined tags for tasks --- src/model/task.py | 5 ++--- src/model/task_tag.py | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 src/model/task_tag.py (limited to 'src/model') diff --git a/src/model/task.py b/src/model/task.py index 4bb9a89..69f9807 100644 --- a/src/model/task.py +++ b/src/model/task.py @@ -1,4 +1,4 @@ -from typing import NamedTuple +from typing import NamedTuple, List from model.difficulty import Difficulty from model.priority import Priority @@ -9,7 +9,6 @@ class Task(NamedTuple): updated_at: int name: str duration: int - tag: str difficulty: Difficulty priority: Priority description: str @@ -17,7 +16,7 @@ class Task(NamedTuple): class ValidTaskForm(NamedTuple): name: str duration: int - tag: str difficulty: Difficulty priority: Priority + tags: List[int] description: str diff --git a/src/model/task_tag.py b/src/model/task_tag.py new file mode 100644 index 0000000..0a33c66 --- /dev/null +++ b/src/model/task_tag.py @@ -0,0 +1,5 @@ +from typing import NamedTuple + +class TaskTag(NamedTuple): + task_id: int + tag_id: int -- cgit v1.2.3