예제 #1
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"]
예제 #2
0
파일: match.py 프로젝트: jimorie/scorebored
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"]
예제 #3
0
class Player(Schema):
    id = fields.Integer()
    name = fields.String()
    stats = fields.List(fields.Nested(Stats))

    class Meta:
        dump_only = ["id"]
예제 #4
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"]
예제 #5
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"]
예제 #6
0
class Result(Schema):
    side = fields.Nested(SideLight)
    score = fields.Integer(default=0)
예제 #7
0
파일: match.py 프로젝트: jimorie/scorebored
class MatchNew(Schema):
    game = fields.String()
    results = fields.List(fields.Nested(ResultNew))