oauth2_client/models.py
def to_client_dict(self):
        """
        Transform this AccessToken to a dict as expected by `OAuth2Session` class

        :return: dict
        """
        as_dict = model_to_dict(self, fields=["token", "token_type", "expires", "scope"])
        as_dict["access_token"] = as_dict.pop('token')
        if 'expires' in as_dict and as_dict['expires']:
            # expiry info can be used by oauth2_session (client's 3rd party parent class)
            expires_dt = as_dict.pop('expires')
            as_dict["expires_in"] = (expires_dt - timezone.now()).total_seconds()
        return as_dict

        Transform this AccessToken to a dict as expected by `OAuth2Session` class

        :return: dict
        
Transform this AccessToken to a dict as expected by `OAuth2Session` class
Transform this AccessToken to a dict as expected by ` OAuth2Session ` class
def to_client_dict(self):
        as_dict = model_to_dict(self, fields=["token", "token_type", "expires", "scope"])
        as_dict["access_token"] = as_dict.pop('token')
        if 'expires' in as_dict and as_dict['expires']:
            expires_dt = as_dict.pop('expires')
            as_dict["expires_in"] = (expires_dt - timezone.now()).total_seconds()
        return as_dict
def to_client_dict ( self ) : as_dict = model_to_dict ( self , fields = [ "token" , "token_type" , "expires" , "scope" ] ) as_dict [ "access_token" ] = as_dict . pop ( 'token' ) if 'expires' in as_dict and as_dict [ 'expires' ] : expires_dt = as_dict . pop ( 'expires' ) as_dict [ "expires_in" ] = ( expires_dt - timezone . now ( ) ) . total_seconds ( ) return as_dict
Transform this AccessToken to a dict as expected by `OAuth2Session` class
Transform this AccessToken to a dict as expected by ` OAuth2Session ` class
"""
        Transform this AccessToken to a dict as expected by `OAuth2Session` class

        :return: dict
        """ # expiry info can be used by oauth2_session (client's 3rd party parent class)
None
self