30 lines
554 B
Python
30 lines
554 B
Python
from dataclasses import dataclass
|
|
from datetime import datetime
|
|
|
|
|
|
@dataclass
|
|
class Activity:
|
|
id: str
|
|
task_id: int
|
|
task_title: str
|
|
description: str
|
|
time_spent: float
|
|
date_start: datetime
|
|
date_end: datetime
|
|
|
|
@property
|
|
def is_tracked(self):
|
|
return self.description.startswith("*")
|
|
|
|
def __str__(self):
|
|
return f'{self.date_start}: {self.description.strip("*")} для задачи "{self.task_title}"'
|
|
|
|
|
|
@dataclass
|
|
class Tag:
|
|
id: str
|
|
title: str
|
|
|
|
def __str__(self):
|
|
return self.title
|