def instantiate_model(self, model_name, model_id, name="Default"): return ModelRegistry.get_model(model_name)._set_data({ "id": model_id, "name": name })
def __init__(self, model_name, aqhttp, session): """Instantiates a new model interface. Uses aqhttp to make requests, and deserializes response to models. :param model_name: Model name (e.g. 'Sample' or 'FieldValue') :type model_name: basestring :param aqhttp: the AqHTTP instance :type aqhttp: AqHTTP :param session: :type session: """ super().__init__(aqhttp, session) self.crud = CRUDInterface(aqhttp, session) self.model = ModelRegistry.get_model(model_name) self._do_load = True
def __init__(self, model_name, aqhttp, session): super().__init__(aqhttp, session) self.crud = CRUDInterface(aqhttp, session) self.model = ModelRegistry.get_model(model_name) self._do_load = True self._preload_field_values = None
def get_model(self): return ModelRegistry.get_model(self.nested)
def test_nested_dump_benchmark(self, base, Author, Publisher, Company, benchmark, model, include, expected): instance = ModelRegistry.get_model(model)() benchmark(instance.dump, include=include) assert instance.dump(include=include) == expected