new: Allow to force the timestamps in to_dict/to_json, even if a change was made

pull/858/head
Raphaël Vinot 2022-08-15 18:35:53 +02:00
parent 3ca8717e6c
commit 289ce47d64
1 changed files with 8 additions and 0 deletions

View File

@ -280,6 +280,14 @@ class AbstractMISP(MutableMapping, MISPFileCache, metaclass=ABCMeta):
def __len__(self) -> int:
return len([k for k in self.__dict__.keys() if not (k[0] == '_' or k in self.__not_jsonable)])
@property
def force_timestamp(self) -> bool:
return self.__force_timestamps
@force_timestamp.setter
def force_timestamp(self, force: bool):
self.__force_timestamps = force
@property
def edited(self) -> bool:
"""Recursively check if an object has been edited and update the flag accordingly