Ejemplo n.º 1
0
 def __createTeamSeason(self):
     teamSeasonSchema = TeamSeasonSchema()
     teamSeasonSchema.team = self.teamId
     teamSeasonSchema.season = self.season
     teamSeasonId = TeamSeasonsTable.create(teamSeasonSchema)
     teamSeasonSchema.id = teamSeasonId
     return TeamSeasonTranslator.toDomain(teamSeasonSchema)
    def getTeamSeasonId(teamSeason):
        if teamSeason.id > 0:
            return teamSeason.id

        teamSeasonSchema = TeamSeasonTranslator.toSchema(teamSeason)
        fromTable = TeamSeasonsTable.retrieveByTeamAndSeason(
            teamSeasonSchema.team, teamSeasonSchema.season)
        if fromTable is not None:
            return fromTable.id

        return TeamSeasonsTable.create(teamSeasonSchema)