def user_to_dict(self, user):
    "Returns a dictionary based on a user object.\n\n        Extra attributes to be retrieved must be set in this module's\n        configuration.\n\n        :param user:\n            User object: an instance the custom user model.\n        :returns:\n            A dictionary with user data.\n        "
    if (not user):
        return None
    user_dict = dict(((a, getattr(user, a)) for a in self.user_attributes))
    user_dict['user_id'] = user.key.id()
    return user_dict
Returns a dictionary based on a user object.

Extra attributes to be retrieved must be set in this module's
configuration.

:param user:
    User object: an instance the custom user model.
:returns:
    A dictionary with user data.
def user_to_dict(self, user):
    "Returns a dictionary based on a user object.\n\n        Extra attributes to be retrieved must be set in this module's\n        configuration.\n\n        :param user:\n            User object: an instance the custom user model.\n        :returns:\n            A dictionary with user data.\n        "
    if (not user):
        return None
    user_dict = dict(((a, getattr(user, a)) for a in self.user_attributes))
    user_dict['user_id'] = user.key.id()
    return user_dict