X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=plomtask%2Fversioned_attributes.py;h=cc42bbc40f761c35715f11b0ca4f61ba67dbe579;hb=84ff28d055b785e5f205f942c68ece72136e5af1;hp=cbd1c8e348a9230b10176d55b4b6a490fe11ff33;hpb=fa05073a6ebaf46e8f72bec10a3dc03021ce704c;p=plomtask diff --git a/plomtask/versioned_attributes.py b/plomtask/versioned_attributes.py index cbd1c8e..cc42bbc 100644 --- a/plomtask/versioned_attributes.py +++ b/plomtask/versioned_attributes.py @@ -25,6 +25,12 @@ class VersionedAttribute: 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."""