def response(self, http_response, response_body): r = Response() r.status = http_response.status r.success = r.status >= 200 and r.status < 400 r.raw = response_body r.raw_format = self.config_value('format', 'json') r.meta = dict(http_response.getheaders()) return r
def _parse_response(self, raw): response = Response() response.raw = raw response._parsed = raw if raw.has_key('fields'): response.success = True response._model_attributes = raw['fields'] elif raw.has_key('success'): response.success = raw['success'] return response