Files
redmine_tracker/classes.py
2025-05-15 13:44:09 +03:00

28 lines
579 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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