self.default = default
self.history: dict[str, str | float] = {}
+ def __hash__(self) -> int:
+ history_tuples = tuple((k, v) for k, v in self.history.items())
+ hashable = (self.parent.id_, self.table_name, self.default,
+ history_tuples)
+ return hash(hashable)
+
+ @property
+ def as_dict(self) -> dict[str, object]:
+ """Return self as (json.dumps-coompatible) dict."""
+ d = {'parent_id': self.parent.id_, 'history': self.history}
+ return d
+
@property
def _newest_timestamp(self) -> str:
"""Return most recent timestamp."""