From a54b7776320ef5aa02e6ef7378c2a011dc454885 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 16 Oct 2021 20:09:55 +0200 Subject: Introduce due date Also: - Remove duration, difficulty and priority, - Translate to french. --- todo/model/difficulty.py | 30 ------------------------------ todo/model/priority.py | 30 ------------------------------ todo/model/task.py | 13 ++++--------- 3 files changed, 4 insertions(+), 69 deletions(-) delete mode 100644 todo/model/difficulty.py delete mode 100644 todo/model/priority.py (limited to 'todo/model') 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 -- cgit v1.2.3