From 0c4a107dcca0b8d22d7404e71a89355845c6ffc1 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sun, 9 Aug 2015 02:30:54 +0200 Subject: [PATCH] SerializingObject: Fetch TaskAnnotation class dynamically --- tasklib/serializing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasklib/serializing.py b/tasklib/serializing.py index ee04d38..c177984 100644 --- a/tasklib/serializing.py +++ b/tasklib/serializing.py @@ -1,4 +1,5 @@ import datetime +import importlib import json import pytz import six @@ -164,6 +165,8 @@ class SerializingObject(object): return serialized_annotations if serialized_annotations else '' def deserialize_annotations(self, data): + task_module = importlib.import_module('tasklib.task') + TaskAnnotation = getattr(task_module, 'TaskAnnotation') return [TaskAnnotation(self, d) for d in data] if data else [] def serialize_tags(self, tags): -- 2.39.5