This commit is contained in:
2025-05-15 13:44:09 +03:00
parent 0294c3d540
commit da7ae0a370
6 changed files with 185 additions and 27 deletions

27
classes.py Normal file
View File

@@ -0,0 +1,27 @@
from dataclasses import dataclass
from datetime import datetime
@dataclass
class Activity:
task_id: int
task_title: str
description: str
time_spent: float
date: datetime = datetime.now()
@property
def is_tracked(self):
return self.description.startswith("*")
def __str__(self):
return f'{self.date}: {self.description.strip("*")} для задачи "{self.task_title}"' + (" - ЗАТРЕКАНА" if self.is_tracked else "")
@dataclass
class Tag:
id: str
title: str
def __str__(self):
return self.title