X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/514a4aaf6086dfa93948ca58303009d8d400ef64..5f535b50023187e987751d4f34c32b4c1f7a8959:/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