sol.models.club -- Clubs

class sol.models.club.Club(**kwargs)

A club, which organizes championships of tourneys.

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

Check description validity.

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

Check description validity.

countChampionships()

Return the number of championships organized by this club.

countPlayers()

Return the number of players associated to this club.

serialize(serializer: Serializer) SerializedClub

Reduce a single club to a simple dictionary.

Parameters:

serializer -- a Serializer instance

Return type:

dict

Returns:

a plain dictionary containing a flatified view of this club

associated_players: Mapped[list[Player]]

Players associated with this club.

championships: Mapped[list[Championship]]

Championships organized by this club.

property country

The name of the club's country.

couplings: Mapped[str | None]

Kind of pairing method used to build next round, used as default value for the corresponding field when creating a new championship.

description: Mapped[str]

Description of the club.

email: Mapped[str | None]

Email address of the club.

emblem: Mapped[str | None]

Logo of the club, used on badges.

This is just the filename, referencing a picture inside the sol.emblems_dir directory.

federated_players: Mapped[list[Player]]

Players associated with this federation.

hosted_tourneys: Mapped[list[Tourney]]

Tourneys <.Tourney> hosted by this club.

idclub: Mapped[int]

Primary key.

idowner: Mapped[int | None]

ID of the user that is responsible for this record.

idrating: Mapped[int | None]

Possible rating ID, used as default value for the corresponding field when creating a new championship.

isfederation: Mapped[bool]

Flag indicating whether the club is also a federation.

modified: Mapped[datetime]

Last update timestamp.

nationality: Mapped[str]

ISO country code to compute national rankings.

owner: Mapped[User | None]

The owner of this record, admin when None.

prizes: Mapped[str]

Kind of prize-giving, used as default value for the corresponding field when creating a new championship.

This is used to determine which method will be used to assign final prizes. It may be:

asis

means that the final prize is the same as the competitor's points;

fixed

means the usual way, that is 18 points to the winner, 16 to the second, 14 to the third, 13 to the fourth, …, 1 point to the 16th, 0 points after that;

fixed40

similar to fixed, but applied to best fourty scores starting from 1000:

  1. 1000

  2. 900

  3. 800

  4. 750

  5. 700

  6. 650

  7. 600

  8. 550

  9. 500

  10. 450

  11. 400

  12. 375

  13. 350

  14. 325

  15. 300

  16. 275

  17. 250

  18. 225

  19. 200

  20. 175

  21. 150

  22. 140

  23. 130

  24. 120

  25. 110

  26. 100

  27. 90

  28. 80

  29. 70

  30. 60

  31. 50

  32. 40

  33. 35

  34. 30

  35. 25

  36. 20

  37. 15

  38. 10

  39. 5

  40. 1

millesimal

is the classic method, that distributes a multiple of 1000/num-of-competitors.

rating: Mapped[Rating | None]

Default Ratings used by this club's championships.

ratings: Mapped[list[Rating]]

Ratings reserved for tourneys organized by this club.

siteurl: Mapped[str | None]

Web site URL.