You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to divide the current parse(body, headers) method, which parses the http response and returns a dict with the model or collection values, into a parse_response(body, headers) method that only parses the response and returns a raw dict, and a parse(raw) method that receives the raw dict from parse_response and returns a new dict with the values for the model or collection.
I think I will start moving the parse(self, body, headers) method to an static method named parse_response to be called before creating a new model instance in the Collection's get and all methods.
I would like to divide the current
parse(body, headers)
method, which parses the http response and returns a dict with the model or collection values, into aparse_response(body, headers)
method that only parses the response and returns a raw dict, and aparse(raw)
method that receives the raw dict fromparse_response
and returns a new dict with the values for the model or collection.See the example below:
Also, that way we could call the
Model.parse
method for each item when retrieving an entire collection.The text was updated successfully, but these errors were encountered: