def load(self, response):
        """Parse the GET response for the collection.

        This operates as a lazy-loader, meaning that the data are only downloaded
        from the server if there are not already loaded.
        Collection items are loaded sequentially.

        In some rare cases, a collection can have an asynchronous request
        triggered.  For those cases, we handle it here.
        """
        self._models = []
        if isinstance(response, dict):
            for key in response.keys():
                model = self.model_class(self, href='')
                model.load(response[key])
                self._models.append(model)
        else:
            for item in response:
                model = self.model_class(self,
                                         href=item.get('href'))
                model.load(item)
                self._models.append(model)
def load ( self , response ) : self . _models = [ ] if isinstance ( response , dict ) : for key in response . keys ( ) : model = self . model_class ( self , href = '' ) model . load ( response [ key ] ) self . _models . append ( model ) else : for item in response : model = self . model_class ( self , href = item . get ( 'href' ) ) model . load ( item ) self . _models . append ( model )
Parse the GET response for the collection.

        This operates as a lazy-loader, meaning that the data are only downloaded
        from the server if there are not already loaded.
        Collection items are loaded sequentially.

        In some rare cases, a collection can have an asynchronous request
        triggered.  For those cases, we handle it here.