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"]
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"]
class Player(Schema): id = fields.Integer() name = fields.String() stats = fields.List(fields.Nested(Stats)) class Meta: dump_only = ["id"]
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"]
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"]
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"]
class GameId(Schema): game_id = fields.Integer()
class Result(Schema): side = fields.Nested(SideLight) score = fields.Integer(default=0)
class ResultNew(Schema): players = fields.List(fields.String()) score = fields.Integer(default=0)
class SideId(Schema): side_id = fields.Integer()
class Visitor(Schema): id = fields.Integer() name = fields.String() location = fields.String() ip_addr = fields.String()
class VisitorPath(Schema): visitor_id = fields.Integer()
class MatchId(Schema): match_id = fields.Integer()
class PlayerId(Schema): player_id = fields.Integer()