assembl.models.social_auth module

Models for integration of Python Social Auth.

class assembl.models.social_auth.AppSocialAuthMixin(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base, social_sqlalchemy.storage.SQLAlchemyMixin

save()[source]

Encapsulate db.add().

class assembl.models.social_auth.Association(**kwargs)[source]

Bases: assembl.models.social_auth.AppSocialAuthMixin, social_sqlalchemy.storage.SQLAlchemyAssociationMixin

class assembl.models.social_auth.Code(**kwargs)[source]

Bases: assembl.models.social_auth.AppSocialAuthMixin, social_sqlalchemy.storage.SQLAlchemyCodeMixin

class assembl.models.social_auth.Nonce(**kwargs)[source]

Bases: assembl.models.social_auth.AppSocialAuthMixin, social_sqlalchemy.storage.SQLAlchemyNonceMixin

class assembl.models.social_auth.SocialAuthAccount(**kwargs)[source]

Bases: assembl.models.auth.AbstractAgentAccount, assembl.models.social_auth.AppSocialAuthMixin, social_core.storage.UserMixin

An account with an external auth.IdentityProvider

classmethod allowed_to_disconnect(user, backend_name, association_id=None)[source]

Return if it’s safe to disconnect the social account for the given user

classmethod changed(user)[source]

The given user instance is ready to be saved

classmethod create_social_auth(user, uid, provider)[source]

Create a UserSocialAuth instance for given user

classmethod create_user(email=None, username=None, fullname=None, *args, **kwargs)[source]

Create a user instance

classmethod disconnect(entry)[source]

Disconnect the social account for the given user

classmethod get_social_auth(provider, uid)[source]

Return UserSocialAuth for given provider and uid

classmethod get_social_auth_for_user(user, provider=None, id=None)[source]

Return all the UserSocialAuth instances for given user

classmethod get_user(pk)[source]

Return user instance for given id

classmethod get_username(user)[source]

Return the username for given user

classmethod get_users_by_email(email)[source]

Return users instances for given email address

property provider

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

signature()[source]

Identity of signature implies identity of underlying account

unique_query()[source]

returns a couple (query, usable), with a sqla query for conflicting similar objects. usable is true if the query has to be enforced; sometimes it makes sense to return un-usable query that will be used to construct queries of subclasses. Note that when a duplicate is found, you’ll often want to expunge the original.

classmethod user_exists(*args, **kwargs)[source]

Return True/False if a User instance exists with the given arguments. Arguments are directly passed to filter() manager method.

classmethod user_model()[source]

Return the user model

classmethod username_max_length()[source]

Return the max length for username