def _from_dict ( cls , _dict ) : args = { } if 'collections' in _dict : args [ 'collections' ] = [ Collection . _from_dict ( x ) for x in ( _dict . get ( 'collections' ) ) ] return cls ( * * args )
python mongodb model how to initialize collection from json
Initialize a ListCollectionsResponse object from a json dictionary .
def _from_dict(cls, _dict):
        """Initialize a ListCollectionsResponse object from a json dictionary."""
        args = {}
        if 'collections' in _dict:
            args['collections'] = [
                Collection._from_dict(x) for x in (_dict.get('collections'))
            ]
        return cls(**args)