sol.models.match -- Matches

class sol.models.match.Match(**kwargs)

A single match.

This table contains all the matches played in the various rounds of a tourney. A match may be between two different competitors or between a competitor and a placeholder, when the number of competitors is odd.

board

The number of the carromboard this match is played on.

caption(html=None, localized=True)

A description of the match, made up with the description of each competitor.

competitor1

First competitor

property competitor1FullName

Full name of the first competitor

property competitor1Opponents

List of competitors ID who played against the first competitor

competitor2

Second competitor (may be None, the Phantom).

property competitor2FullName

Full name of the second competitor

property competitor2Opponents

List of competitors ID who played against the second competitor

property description

A description of the match, made up with the description of each competitor.

final

Whether the match is a normal one or a final.

idcompetitor1

First competitor's ID.

idcompetitor2

Second competitor's ID (possibly None).

idmatch

Primary key.

idtourney

Related tourney's ID.

misses1_1

Errors of the first competitor in board 1, for training matches.

misses1_2

Errors of the first competitor in board 2, for training matches.

misses1_3

Errors of the first competitor in board 3, for training matches.

misses1_4

Errors of the first competitor in board 4, for training matches.

misses1_5

Errors of the first competitor in board 5, for training matches.

misses1_6

Errors of the first competitor in board 6, for training matches.

misses1_7

Errors of the first competitor in board 7, for training matches.

misses1_8

Errors of the first competitor in board 8, for training matches.

misses2_1

Errors of the second competitor in board 1, for training matches.

misses2_2

Errors of the second competitor in board 2, for training matches.

misses2_3

Errors of the second competitor in board 3, for training matches.

misses2_4

Errors of the second competitor in board 4, for training matches.

misses2_5

Errors of the second competitor in board 5, for training matches.

misses2_6

Errors of the second competitor in board 6, for training matches.

misses2_7

Errors of the second competitor in board 7, for training matches.

misses2_8

Errors of the second competitor in board 8, for training matches.

results()

Results of this match, comparing competitor' scores.

Return type

tuple

Returns

winner, loser, netscore

score1

Score of the first competitor.

score2

Score of the second competitor.

serialize(serializer, competitors)

Reduce a single match to a simple dictionary.

Parameters
  • serializer -- a Serializer instance

  • competitors -- a mapping between competitor integer ID to its integer marker

Return type

dict

Returns

a plain dictionary containing a flatified view of this match

turn

Round number of the match.