def _decode_term(obj): """Decodes a term from a dictionary. """ instance = Term() instance.alternative_name = obj['alternative_name'] instance.alternative_url = obj['alternative_url'] instance.create_date = arrow.get(obj['create_date']).datetime instance.data = obj['data'] instance.description = obj['description'] instance.idx = obj['idx'] instance.label = obj['label'] instance.name = obj['name'] instance.status = obj['status'] instance.synonyms = obj['synonyms'] instance.uid = uuid.UUID(unicode(obj['uid'])) instance.url = obj['url'] if instance.parent: instance.parent = uuid.UUID(unicode(obj['parent'])) return instance