home · contact · privacy
Extend Conditions POST test to use new JSON interface.
[plomtask] / plomtask / versioned_attributes.py
index cbd1c8e348a9230b10176d55b4b6a490fe11ff33..cc42bbc40f761c35715f11b0ca4f61ba67dbe579 100644 (file)
@@ -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."""