From dec137220cf360d5943ba3d868e73cf3ad2f1a2e Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 30 Nov 2021 17:48:08 +0100 Subject: [PATCH] Improved TableABC --- src/cpl_core/database/table_abc.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cpl_core/database/table_abc.py b/src/cpl_core/database/table_abc.py index 55c31951..035633d7 100644 --- a/src/cpl_core/database/table_abc.py +++ b/src/cpl_core/database/table_abc.py @@ -7,8 +7,8 @@ class TableABC(ABC): @abstractmethod def __init__(self): - self._created_at: Optional[datetime] = None - self._modified_at: Optional[datetime] = None + self._created_at: Optional[datetime] = datetime.now().isoformat() + self._modified_at: Optional[datetime] = datetime.now().isoformat() @property def created_at(self) -> datetime: @@ -17,6 +17,10 @@ class TableABC(ABC): @property def modified_at(self) -> datetime: return self._modified_at + + @modified_at.setter + def modified_at(self, value: datetime): + self._modified_at = value @staticmethod @abstractmethod