sol.models.user -- User

class sol.models.user.User(**kwargs)

A single user of the system.

caption(html=None, localized=True)

Description of the user, made up concatenating his names.

classmethod check_insert(session: Session, fields: dict[str, Any], user_id: str | int) None

Prevent duplicated user.

check_password(raw_password: bytes | str) bool

Check the password.

Parameters:

raw_password -- the raw password, in clear

Return type:

boolean

Return True if the raw_password matches the user's password, False otherwise.

check_update(fields: dict[str, Any], user_id: str | int) None

Perform any check before updating the instance.

delete()

Prevent deletion if this user owns something.

serialize(serializer: Serializer) SerializedUser

Reduce a single user to a simple dictionary.

Parameters:

serializer -- a Serializer instance

Return type:

dict

Returns:

a plain dictionary containing a flatified view of this user

created: Mapped[datetime]

Timestamp of record creation.

property description

Description of the user, made up concatenating his names.

email: Mapped[str]

Email address of the user.

firstname: Mapped[str]

User's first name.

iduser: Mapped[int]

Primary key.

language: Mapped[str | None]

The ISO code of the preferred language of the user.

lastlogin: Mapped[datetime | None]

The timestamp of the last successful login, if any.

lastname: Mapped[str]

User's last name.

maxratinglevel: Mapped[str]

The highest level of rating available to this user.

nationalliable: Mapped[str]

ISO country code of the country the user is responsible for, and thus can edit players and clubs, even when owned by a different user.

owned_championships: Mapped[list[Championship]]

List of owned championships.

owned_clubs: Mapped[list[Club]]

List of owned clubs.

owned_players: Mapped[list[Player]]

List of owned players.

owned_ratings: Mapped[list[Rating]]

List of owned ratings.

owned_tourneys: Mapped[list[Tourney]]

List of owned tourneys.

ownersadmin: Mapped[bool]

Whether the user can change ownership of other items.

password

Return the hashed password of the user.

playersmanager: Mapped[bool]

Whether the user can manage players.

state: Mapped[str]

The status of the user: R means registered, C means confirmed, S means suspended.