pluserable.data.repository module¶
Repository implementations.
Repositories are persistence strategies.
- class pluserable.data.repository.AbstractRepo(kerno, session_factory=None)[source]¶
Bases:
kerno.repository.sqlalchemy.BaseSQLAlchemyRepository,Generic[pluserable.data.typing.TActivation,pluserable.data.typing.TGroup,pluserable.data.typing.TTUser]An abstract base class (ABC) defining the repository interface.
- abstract delete_activation(user, activation)[source]¶
Delete the Activation instance from the database.
- Return type
None
- abstract get_activation_by_code(code)[source]¶
Return the Activation with
code, or None.- Return type
Optional[TypeVar(TActivation)]
- abstract get_or_create_user_by_email(email, details)[source]¶
Return User if
emailexists, else create it withdetails.- Return type
TypeVar(TTUser)
- abstract get_user_by_activation(activation)[source]¶
Return the user with
activation, or None.- Return type
Optional[TypeVar(TTUser)]
- abstract get_user_by_email(email)[source]¶
Return a user with
email, or None.- Return type
Optional[TypeVar(TTUser)]
- abstract get_user_by_id(id)[source]¶
Return the user with
id, or None.- Return type
Optional[TypeVar(TTUser)]
- abstract get_user_by_username(username)[source]¶
Return a user with
username, or None. Case-insensitive.- Return type
Optional[TypeVar(TTUser)]
- abstract one_user_by_email(email)[source]¶
Return a user with
email, or raise.- Return type
TypeVar(TTUser)