Tourneys — SoL 3 developers documentation

### Navigation

- index
- modules |
- next |
- previous |
- Dev's documentation »
- SoL modules »
- `sol.models` – SQLAlchemy modelization »

# Tourneys

class `sol.models.tourney.` `Tourney`(**kwargs)

  A single tournament.

  `allPlayers`()

    Generator that return all involved players.

  `assignPrizes`()

    Consolidate final points.

  `competitors`

    List of competitors.

  `couplings`

    Kind of coupling used to build next turn. It may be serial or dazed.

  `currentturn`

    The current turn.

  `date`

    Event date.

  `description`

    Event description.

  `duration`

    Duration in minutes of each turn, used by the clock.

  `idchampionship`

    Related championship’s ID.

  `idowner`

    ID of the user that is responsible of this record.

  `idrating`

    Possible rating ID this tourney uses and updates.

  `idtourney`

    Primary key.

  `location`

    Event location.

  `makeNextTurn`()

    Setup the next turn.

    If there are no matches, build up the first turn using a random coupler. Otherwise, using current ranking, create the next turn coupling any given competitor with a not-yet-met other one that follows him in the ranking.

  `matches`

    List of matches, sorted by turn and board.

  `owner`

    The owner of this record, admin when `None`.

  `phantomscore`

    The score assigned to a player in matches against the Phantom.

  `prealarm`

    Prealarm before the end of the turn.

  `prized`

    Whether the tourney is closed, and final prizes updated.

  `rankedturn`

    The highest turn considered in the ranking.

  `ranking`

    Competitors sorted by their rank.

    Update the ranking if needed, that is if currentturn is higher than rankedturn.

  `replay`(date, newidowner=None)

    Clone this tourney, creating new one at given date.

    Of the original, only the competitors are copied. This is particularly useful for doubles (or team), so that the players get copied in the same order.

  `resetPrizes`()

    Reset assigned final points.

  `serialize`(serializer)

    Reduce a single tourney to a simple dictionary

  `updateRanking`()

    Recompute competitors ranking.

    Update each competitor rank by examining the matches of this tourney, summing up each other’s current ranking position as the bucholz.

### Navigation

- index
- modules |
- next |
- previous |
- Dev's documentation »
- SoL modules »
- `sol.models` – SQLAlchemy modelization »