def object_from_json(cls, key, value): if key == 'user': return User.from_json(value) if key == 'client': return Client.from_json(value) return value