def render_GET(self, request): """Process GET Request.""" self._request = request _act = request.args.get('act') if _act != None and 'getSchemaModel' in _act: return self.get_schema_model() elif _act != None and 'view' in _act: Address.view(self) return server.NOT_DONE_YET elif _act != None and 'get' in _act: Address.get(self) return server.NOT_DONE_YET else: return json.dumps( {'success' : False, 'error' : 'Not implemented yet.'})
def get_schema_model(self): """Return the schema model Address architecture.""" model_schema, model_view = Address.get_model_info() if model_schema == None: return json.dumps({ "success" : False, "error" : "Unable to fetch a schema for model address" }) return json.dumps({ "success" : True, "model" : model_schema, "view" : model_view })
def render_POST(self, request): """Process POST Request.""" self._request = request _act = request.args.get('act') if _act != None and 'create' in _act: Address.create(self) return server.NOT_DONE_YET elif _act != None and 'update' in _act: Address.update(self) return server.NOT_DONE_YET elif _act != None and 'destroy' in _act: Address.destroy(self) return server.NOT_DONE_YET else: return json.dumps( {'success' : False, 'error' : 'Not implemented yet.'})