예제 #1
0
    def delete_schedule(schedule_id):
        schedule_model = ScheduleModel.get_schedule_by_id(schedule_id=schedule_id, return_as_model=True)

        if schedule_model:
            mlbdb.delete(schedule_model)
            mlbdb.commit()

            return schedule_model.as_dict()

        return None
예제 #2
0
    def delete_game(game_id):
        game_model = GameModel.get_game_by_id(game_id=game_id,
                                              return_as_model=True)

        if game_model:
            mlbdb.delete(game_model)
            mlbdb.commit()

            return game_model.as_dict()

        return None
예제 #3
0
    def delete_expectation(expectation_id):
        expectation_model = ExpectationModel.get_expectation_by_id(
            expectation_id=expectation_id, return_as_model=True)

        if expectation_model:
            mlbdb.delete(expectation_model)
            mlbdb.commit()

            return expectation_model.as_dict()

        return None
예제 #4
0
    def delete_weather_report(weather_report_id):
        weather_report_model = WeatherReportModel.get_weather_report_by_id(
            weather_report_id=weather_report_id, return_as_model=True)

        if weather_report_model:
            mlbdb.delete(weather_report_model)
            mlbdb.commit()

            return weather_report_model.as_dict()

        return None
예제 #5
0
    def delete_team(team_id):
        team_model = TeamModel.get_team_by_id(team_id=team_id,
                                              return_as_model=True)

        if team_model:
            mlbdb.delete(team_model)
            mlbdb.commit()

            return team_model.as_dict()

        return None
예제 #6
0
    def delete_injury_report(injury_report_id):
        injury_report_model = InjuryReportModel.get_injury_report_by_id(
            injury_report_id=injury_report_id, return_as_model=True)

        if injury_report_model:
            mlbdb.delete(injury_report_model)
            mlbdb.commit()

            return injury_report_model.as_dict()

        return None
예제 #7
0
    def delete_player(player_id):
        player_model = PlayerModel.get_player_by_id(player_id=player_id,
                                                    return_as_model=True)

        if player_model:
            mlbdb.delete(player_model)
            mlbdb.commit()

            return player_model.as_dict()

        return None
예제 #8
0
    def delete_season(season_id):
        season_model = SeasonModel.get_season_by_id(season_id=season_id,
                                                    return_as_model=True)

        if season_model:
            mlbdb.delete(season_model)
            mlbdb.commit()

            return season_model.as_dict()

        return None