pluserable.data.sqlalchemy.repository module¶
Use the SQLAlchemy session to retrieve and store models.
- class pluserable.data.sqlalchemy.repository.Repository(kerno, session_factory=None)[source]¶
Bases:
pluserable.data.repository.AbstractRepo,Generic[pluserable.data.typing.TActivation,pluserable.data.typing.TGroup]A repository that uses SQLAlchemy for storage.
- Activation¶
- Group¶
- User¶
- delete_activation(user, activation)[source]¶
Delete the Activation instance from the database.
- Return type
None
- get_activation_by_code(code)[source]¶
Return the Activation with
code, or None.- Return type
Optional[TypeVar(TActivation)]
- get_or_create_user_by_email(email, details)[source]¶
Return User if
emailexists, else create User withdetails.The returned User instance has a transient
is_newflag. If the user is new, they need to go through password recovery. # TODO No access to tmp_password, create activation, send email- Return type
- get_user_by_activation(activation)[source]¶
Return the user with
activation, or None.- Return type
Optional[TUser]
- get_user_by_username(username)[source]¶
Return a user with
username, or None. Case-insensitive.- Return type
Optional[TUser]