Skip to content

kamihi.users.models.user ⚓︎

User model.

License

MIT

Classes:

Name Description
User

Placeholder for the User model.

User ⚓︎

Bases: Document

Placeholder for the User model.

Methods:

Name Description
get_model

Get the model class for the User.

set_model

Set the model class for the User.

get_model classmethod ⚓︎

get_model() -> type[User]

Get the model class for the User.

Returns:

Name Type Description
type type[User]

The model class for the User.

Source code in src/kamihi/users/models/user.py
23
24
25
26
27
28
29
30
31
32
@classmethod
def get_model(cls) -> type["User"]:
    """
    Get the model class for the User.

    Returns:
        type: The model class for the User.

    """
    return cls if cls._model is None else cls._model

set_model classmethod ⚓︎

set_model(model: type[User]) -> None

Set the model class for the User.

Parameters:

Name Type Description Default

model ⚓︎

type

The model class to set.

required
Source code in src/kamihi/users/models/user.py
34
35
36
37
38
39
40
41
42
43
@classmethod
def set_model(cls, model: type["User"]) -> None:
    """
    Set the model class for the User.

    Args:
        model (type): The model class to set.

    """
    cls._model = model