Merged players

class sol.models.mergedplayer.MergedPlayer(**kwargs)

A player who has been merged into another.

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

Perform any check before an new instance is inserted.

Parameters:
  • session -- the SA session

  • fields -- a dictionary with the fields values

  • user_id -- either None, to mean "admin", or the ID of the user performing the operation

caption(html=None, localized=True)

Description of the player, made up concatenating his names.

check_delete(user_id: int | None) None

Perform any check before deleting the instance.

Parameters:

user_id -- either None, to mean "admin", or the ID of the user performing the operation

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

Perform any check before updating the instance.

Parameters:
  • fields -- a mapping containing fieldname -> value associations

  • user_id -- either None, to mean "admin", or the ID of the user performing the operation

This implementation does nothing, but subclasses can override it at will, either to adapt incoming values or to check their validity, raising an exception if something is wrong.

property description

Description of the player, made up concatenating his names.

firstname: Mapped[str]

Player's first name.

idmergedplayer: Mapped[int]

Primary key.

idplayer: Mapped[int]

Target player's ID.

lastname: Mapped[str]

Player's last name.

modified: Mapped[datetime]

Last update timestamp.

nickname: Mapped[str]

Player's nickname, used also for login purposes.

player: Mapped[Player]

The player this has been merged into.