sol.models.championship
– Championships¶
-
class
sol.models.championship.
Championship
(**kwargs)¶ A series of tournaments organized by the same club.
-
closed
¶ Whether the championships is close, and its ranking finalized.
-
couplings
¶ Kind of pairing method used to build next round, used as default value for the corresponding field when creating a new tourney.
-
description
¶ Description of the championship.
-
idchampionship
¶ Primary key.
-
idprevious
¶ Previous championship’s ID.
-
playersperteam
¶ Number of players per team.
-
previous
¶ Previous championship.
-
prizes
¶ Kind of prize-giving.
This is used to determine which method will be used to assign final prizes. It may be:
- asis
- means that the final prize is a plain integer number, monotonically decreasing down to 1 starting from num-of-competitors: this is meant to give the chance of swapping competitors positions after tournament’s final rounds, the final prize column won’t even show up in the final ranking printout;
- 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:
- 1000
- 900
- 800
- 750
- 700
- 650
- 600
- 550
- 500
- 450
- 400
- 375
- 350
- 325
- 300
- 275
- 250
- 225
- 200
- 175
- 150
- 140
- 130
- 120
- 110
- 100
- 90
- 80
- 70
- 60
- 50
- 40
- 35
- 30
- 25
- 20
- 15
- 10
- 5
- 1
- millesimal
- is the classic method, that distributes a multiple of 1000/num-of-competitors;
- centesimal
- assigns 100 to the first ranked competitor, 1 to the last, linear interpolation to the other competitors.
-
ranking
(limit=None, onlywomen=False)¶ Summarize the championship, collecting final prizes of the players.
Parameters: - limit (either
None
or a date instance) – the earliest date to consider - onlywomen (a boolean) – whether only women should be considered
Return type: a tuple of two slots
For each tuple of players collect the earned prize in each tourney of the championship, or zero if the players did not participate to a given event.
limit and onlywomen are used by the general rankings, to consider only last year tourneys and to produce women ranking respectively.
Results in a tuple of two items, the first being a list of two slots tuples, respectively the date and the guid of a tourney, the second a list of tuples, sorted by total prize: each tuple contains five items, a tuple of players, their total prize, a list of their prizes sorted by date of event, the number of prizes and finally either None or a list of skipped prizes.
- limit (either
-
serialize
(serializer)¶ Reduce a single championship to a simple dictionary.
Parameters: serializer – a Serializer
instanceReturn type: dict Returns: a plain dictionary containing a flatified view of this championship
-
skipworstprizes
¶ Number of worst results to skip in computing the ranking.
-