MibooGram/modules/action_log/models.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
493 B
Python
Raw Permalink Normal View History

2024-07-06 05:35:04 +00:00
from datetime import datetime, timedelta
from pydantic import BaseModel
from simnet.models.zzz.self_help import ZZZSelfHelpActionLog
class ActionLogPair(BaseModel):
start: ZZZSelfHelpActionLog
end: ZZZSelfHelpActionLog
@property
def start_time(self) -> datetime:
return self.start.time
@property
def end_time(self) -> datetime:
return self.end.time
@property
def duration(self) -> timedelta:
return self.end.time - self.start.time