def write_error(self, resource, error): error_data = self.get_error_data( resource=resource, error=error ) json_data = utils.json_dumps(error_data.as_dict()) self.r.set(self.key(resource.url), json_data)
def write_response(self, resource, response): response_data = self.get_response_data(response=response) json_data = utils.json_dumps(response_data.as_dict()) self.r.set(self.key(resource.url), json_data)