aboutsummaryrefslogtreecommitdiff
path: root/todo/model
diff options
context:
space:
mode:
Diffstat (limited to 'todo/model')
-rw-r--r--todo/model/difficulty.py30
-rw-r--r--todo/model/priority.py30
-rw-r--r--todo/model/task.py13
3 files changed, 4 insertions, 69 deletions
diff --git a/todo/model/difficulty.py b/todo/model/difficulty.py
deleted file mode 100644
index 526cdb9..0000000
--- a/todo/model/difficulty.py
+++ /dev/null
@@ -1,30 +0,0 @@
-from enum import IntEnum
-from typing import Optional
-
-class Difficulty(IntEnum):
- EASY = 0
- NORMAL = 1
- HARD = 2
-
-values = [
- Difficulty.EASY,
- Difficulty.NORMAL,
- Difficulty.HARD]
-
-def format(difficulty: Difficulty) -> str:
- if difficulty == Difficulty.EASY:
- return "Easy"
- elif difficulty == Difficulty.NORMAL:
- return "Normal"
- elif difficulty == Difficulty.HARD:
- return "Hard"
-
-def parse(string: str) -> Optional[Difficulty]:
- if string == "Easy":
- return Difficulty.EASY
- elif string == "Normal":
- return Difficulty.NORMAL
- elif string == "Hard":
- return Difficulty.HARD
- else:
- return None
diff --git a/todo/model/priority.py b/todo/model/priority.py
deleted file mode 100644
index 5948104..0000000
--- a/todo/model/priority.py
+++ /dev/null
@@ -1,30 +0,0 @@
-from enum import IntEnum
-from typing import Optional
-
-class Priority(IntEnum):
- LOW = 0
- MIDDLE = 1
- HIGH = 2
-
-values = [
- Priority.LOW,
- Priority.MIDDLE,
- Priority.HIGH]
-
-def format(priority: Priority) -> str:
- if priority == Priority.LOW:
- return "Low"
- elif priority == Priority.MIDDLE:
- return "Middle"
- elif priority == Priority.HIGH:
- return "High"
-
-def parse(string: str) -> Optional[Priority]:
- if string == "Low":
- return Priority.LOW
- elif string == "Middle":
- return Priority.MIDDLE
- elif string == "High":
- return Priority.HIGH
- else:
- return None
diff --git a/todo/model/task.py b/todo/model/task.py
index f20cbc9..086a84b 100644
--- a/todo/model/task.py
+++ b/todo/model/task.py
@@ -1,22 +1,17 @@
from typing import NamedTuple, List
-
-from todo.model.difficulty import Difficulty
-from todo.model.priority import Priority
+from PyQt5 import QtCore
+from datetime import date
class Task(NamedTuple):
id: int
created_at: int
updated_at: int
name: str
- duration: int
- difficulty: Difficulty
- priority: Priority
+ due_date: date
description: str
class ValidTaskForm(NamedTuple):
name: str
- duration: int
- difficulty: Difficulty
- priority: Priority
+ due_date: date
tags: List[int]
description: str