def search(self, params): kind = params.target if kind == Target.tostring(0): return self.search_objects(params) #return '{"result":"Object"}' else: #return self.search_catalog(params) return '{"result":"Catalog"}'
def unpack(self, json_data): result = json.loads(json_data) if result and result['params']: self.term = DictHelper.find('params.term', result) self.target = DictHelper.find('params.target', result) else: return None if self.target == Target.tostring(0): self.__class__ = ObjectParams else: self.__class__ = CatalogParams return self.unpack(json_data)