28 lines
579 B
Python
28 lines
579 B
Python
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
|