From 4cfaeb89fcb189bc9563a59eb72ec3f7e6231bc0 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Tue, 20 Jan 2015 23:35:42 +0100 Subject: [PATCH] SerializingObject: Add missing serialize_annotations method --- tasklib/task.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tasklib/task.py b/tasklib/task.py index f482f53..d386f82 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -99,6 +99,15 @@ class SerializingObject(object): def deserialize_wait(self, value): return self.timestamp_deserializer(value) + def serialize_annotations(self, value): + value = value if value is not None else [] + serialized_annotations = [annotation.export_data() for annotation in value] + + if serialized_annotations: + return '[' + ','.join(serialized_annotations) + ']' + else: + return '' + def deserialize_annotations(self, data): return [TaskAnnotation(self, d) for d in data] if data else [] -- 2.39.5