Example #1
0
class Game(Schema):
    id = fields.Integer()
    name = fields.String()
    side_size_min = fields.Integer(default=1)
    side_size_max = fields.Integer(default=2)
    side_count_min = fields.Integer(default=2)
    side_count_max = fields.Integer(default=2)

    class Meta:
        dump_only = ["id"]
Example #2
0
class Stats(Schema):
    game = fields.Nested(GameLight)
    score_for = fields.Integer(default=0)
    score_against = fields.Integer(default=0)
    matches_played = fields.Integer(default=0)
    matches_won = fields.Integer(default=0)
    matches_lost = fields.Integer(default=0)

    class Meta:
        dump_only = ["id"]
Example #3
0
class Player(Schema):
    id = fields.Integer()
    name = fields.String()
    stats = fields.List(fields.Nested(Stats))

    class Meta:
        dump_only = ["id"]
Example #4
0
class Side(Schema):
    id = fields.Integer()
    name = fields.String()
    players = fields.List(fields.Nested(PlayerLight))
    stats = fields.List(fields.Nested(Stats))

    class Meta:
        dump_only = ["id"]
Example #5
0
class Visit(Schema):
    id = fields.Integer()
    visitor = fields.Nested(Visitor)
    visited_on = fields.String()
    message = fields.String()

    class Meta:
        dump_only = ["id", "visitor", "visited_on", "created_on"]
        load_only = ["visit_id", "visitor_id"]
Example #6
0
class Match(Schema):
    id = fields.Integer()
    game = fields.Nested(GameLight)
    results = fields.List(fields.Nested(Result))
    created_at = fields.String()
    updated_at = fields.String()

    class Meta:
        dump_only = ["id", "created_at", "updated_at"]
Example #7
0
class GameId(Schema):
    game_id = fields.Integer()
Example #8
0
class Result(Schema):
    side = fields.Nested(SideLight)
    score = fields.Integer(default=0)
Example #9
0
class ResultNew(Schema):
    players = fields.List(fields.String())
    score = fields.Integer(default=0)
Example #10
0
class SideId(Schema):
    side_id = fields.Integer()
Example #11
0
class Visitor(Schema):
    id = fields.Integer()
    name = fields.String()
    location = fields.String()
    ip_addr = fields.String()
Example #12
0
class VisitorPath(Schema):
    visitor_id = fields.Integer()
Example #13
0
class MatchId(Schema):
    match_id = fields.Integer()
Example #14
0
class PlayerId(Schema):
    player_id = fields.Integer()