Improved TableABC

This commit is contained in:
Sven Heidemann 2021-11-30 17:48:08 +01:00
parent 01c7e155c3
commit dec137220c

View File

@ -7,8 +7,8 @@ class TableABC(ABC):
@abstractmethod @abstractmethod
def __init__(self): def __init__(self):
self._created_at: Optional[datetime] = None self._created_at: Optional[datetime] = datetime.now().isoformat()
self._modified_at: Optional[datetime] = None self._modified_at: Optional[datetime] = datetime.now().isoformat()
@property @property
def created_at(self) -> datetime: def created_at(self) -> datetime:
@ -18,6 +18,10 @@ class TableABC(ABC):
def modified_at(self) -> datetime: def modified_at(self) -> datetime:
return self._modified_at return self._modified_at
@modified_at.setter
def modified_at(self, value: datetime):
self._modified_at = value
@staticmethod @staticmethod
@abstractmethod @abstractmethod
def get_create_string() -> str: pass def get_create_string() -> str: pass