X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/5ec1eb1a779c700a7abd88f4cc51940b036c50b8..97eff0b3747614feaf9522d1338106ac98978c40:/tasklib/serializing.py?ds=inline diff --git a/tasklib/serializing.py b/tasklib/serializing.py index ff9b977..8cdeaf2 100644 --- a/tasklib/serializing.py +++ b/tasklib/serializing.py @@ -6,7 +6,7 @@ import six import tzlocal -from .lazy import LazyUUIDTaskSet +from .lazy import LazyUUIDTaskSet, LazyUUIDTask DATE_FORMAT = '%Y%m%dT%H%M%SZ' local_zone = tzlocal.get_localzone() @@ -181,6 +181,12 @@ class SerializingObject(object): return set(tags.split(',')) if tags else set() return set(tags or []) + def serialize_parent(self, parent): + return parent['uuid'] if parent else '' + + def deserialize_parent(self, uuid): + return LazyUUIDTask(self.backend, uuid) if uuid else None + def serialize_depends(self, value): # Return the list of uuids value = value if value is not None else set()