コード例 #1
0
ファイル: dto_game.py プロジェクト: jodyunter/teampython
    def __init__(self, game):
        home_team_dto = TeamDTO.get_dto(game.home_team)
        away_team_dto = TeamDTO.get_dto(game.away_team)
        game_rules_dto = GameRulesDTO.get_dto(game.rules)

        Game.__init__(self, game.year, game.day, home_team_dto, away_team_dto,
                      game.home_score, game.away_score, game.complete,
                      game.processed, game_rules_dto, game.oid)
コード例 #2
0
 def get_updated_record(self, original_record):
     original_record.day = 10
     original_record.year = 20
     original_record.home_team = TeamDTO(Team("New Home TEam", 249, False))
     original_record.away_team = TeamDTO(Team("New Away TEam", 244, True))
     original_record.home_score = 30
     original_record.away_score = 30
     original_record.complete = True
     original_record.processed = False
     original_record.rules = GameRulesDTO(GameRules("Rules Name 2", False))
     return original_record
コード例 #3
0
 def get_updated_record(self, original_record):
     original_record.day = 10
     original_record.year = 20
     original_record.home_team = TeamDTO(Team("New Home TEam", 249, False))
     original_record.away_team = TeamDTO(Team("New Away TEam", 244, True))
     original_record.home_score = 30
     original_record.away_score = 30
     original_record.complete = True
     original_record.processed = False
     original_record.rules = GameRulesDTO(GameRules("Rules Name 2", False))
     original_record.competition = CompetitionDTO(Competition("Test 2", 5, None, None, 1, False, True, True, False))
     original_record.sub_competition = TableSubCompetitionDTO(TableSubCompetition("Sub Comp", None, original_record.competition, None, 1, True, True, False, False))
     return original_record
コード例 #4
0
    def __init__(self, competition_game):
        competition = CompetitionDTO.get_dto(competition_game.competition)
        sub_competition = SubCompetitionDTO.get_dto(
            competition_game.sub_competition)
        home_team = CompetitionTeamDTO.get_dto(competition_game.home_team)
        away_team = CompetitionTeamDTO.get_dto(competition_game.away_team)
        rules = GameRulesDTO.get_dto(competition_game.rules)

        CompetitionGame.__init__(
            self, competition, sub_competition, competition_game.day,
            home_team, away_team, competition_game.home_score,
            competition_game.away_score, competition_game.complete,
            competition_game.processed, rules, competition_game.oid)
コード例 #5
0
 def get_add_record(self):
     return GameDTO(Game(1, 2,
                         TeamDTO(Team("Home team", 250, True)),
                         TeamDTO(Team("Away Team", 251, False)),
                         3, 4, False, True, GameRulesDTO(GameRules("Rules Name", False))))
コード例 #6
0
 def __init__(self, series_rules):
     rules = GameRulesDTO.get_dto(series_rules.game_rules)
     SeriesRules.__init__(self, series_rules.name, rules,
                          series_rules.series_type,
                          series_rules.home_pattern, series_rules.oid)
コード例 #7
0
    def get_updated_record(self, original_record):
        original_record.name = "New Name"
        original_record.game_rules = GameRulesDTO(GameRules("Updated Rules", False))
        original_record.home_pattern = [1, 2, 3, 5]

        return original_record
コード例 #8
0
 def get_add_record(self):
     return GameRulesDTO(GameRules("Rules Name", False))