X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/514a4aaf6086dfa93948ca58303009d8d400ef64..97eff0b3747614feaf9522d1338106ac98978c40:/tasklib/serializing.py?ds=inline diff --git a/tasklib/serializing.py b/tasklib/serializing.py index 4594285..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() @@ -178,8 +178,14 @@ class SerializingObject(object): def deserialize_tags(self, tags): if isinstance(tags, six.string_types): - return tags.split(',') if tags else [] - return tags or [] + 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