X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=plomtask%2Ftodos.py;h=7cbe989b538018e480d24752d2d0cc44450f7396;hb=b0758d1c63db38867ef12ee89317524a7436129d;hp=0313e559ee25db4360a14e53cadd31e23a52dda7;hpb=a58f0f088ef7bed064a7752aeebb03498b692e8b;p=plomtask diff --git a/plomtask/todos.py b/plomtask/todos.py index 0313e55..7cbe989 100644 --- a/plomtask/todos.py +++ b/plomtask/todos.py @@ -23,7 +23,7 @@ class Todo(BaseModel[int], ConditionsRelations): """Individual actionable.""" # pylint: disable=too-many-instance-attributes table_name = 'todos' - to_save = ['process_id', 'is_done', 'date', 'comment'] + to_save = ['process_id', 'is_done', 'date', 'comment', 'effort'] to_save_relations = [('todo_conditions', 'todo', 'conditions'), ('todo_enables', 'todo', 'enables'), ('todo_disables', 'todo', 'disables'), @@ -32,7 +32,8 @@ class Todo(BaseModel[int], ConditionsRelations): # pylint: disable=too-many-arguments def __init__(self, id_: int | None, process: Process, - is_done: bool, date: str, comment: str = '') -> None: + is_done: bool, date: str, comment: str = '', + effort: None | float = None) -> None: super().__init__(id_) if process.id_ is None: raise NotFoundException('Process of Todo without ID (not saved?)') @@ -40,6 +41,7 @@ class Todo(BaseModel[int], ConditionsRelations): self._is_done = is_done self.date = date self.comment = comment + self.effort = effort self.children: list[Todo] = [] self.parents: list[Todo] = [] self.conditions: list[Condition] = []