def get_add_record(self): return PlayoffSubCompetitionDTO( PlayoffSubCompetition( "Table Comp", None, CompetitionDTO( Competition("My Comp", 1, None, None, 1, False, False, False, False)), None, 3, 5, True, True, True, True))
def __init__(self, competition_team): competition = CompetitionDTO.get_dto(competition_team.competition) parent_dto = TeamDTO.get_dto(competition_team.parent_team) self.name = competition_team.name self.skill = competition_team.skill self.active = competition_team.active self.oid = competition_team.oid self.competition = competition self.parent_team = parent_dto
def __init__(self, sub_competition): competition = CompetitionDTO.get_dto(sub_competition.compettiion) groups = [ CompetitionGroupDTO.get_dto(g) for g in sub_competition.groups ] SubCompetition.__init__( self, sub_competition.name, sub_competition.sub_competition_type, competition, groups, sub_competition.order, sub_competition.setup, sub_competition.started, sub_competition.finished, sub_competition.post_processed, sub_competition.oid)
def get_updated_record(self, original_record): original_record.name = "New Sub Name" original_record.order = 25 original_record.setup = False original_record.started = False original_record.finished = False original_record.post_processed = False original_record.competition = CompetitionDTO( Competition("Next Comp", 1, None, None, 1, False, False, False, False)) return original_record
def __init__(self, table_sub_competition): competition = CompetitionDTO.get_dto(table_sub_competition.compettiion) groups = [ CompetitionGroupDTO.get_dto(g) for g in table_sub_competition.groups ] records = [TableRecordDTO(r) for r in table_sub_competition.records] TableSubCompetition.__init__( self, table_sub_competition.name, records, competition, groups, table_sub_competition.order, table_sub_competition.setup, table_sub_competition.started, table_sub_competition.finished, table_sub_competition.post_processed, table_sub_competition.oid)
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
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)
def get_add_record(self): return CompetitionDTO( Competition("Comp Name", 1, None, None, 2, False, True, False, True))