diff --git a/app/routers_v3/awards.py b/app/routers_v3/awards.py index fe1d3f4..b7a8428 100644 --- a/app/routers_v3/awards.py +++ b/app/routers_v3/awards.py @@ -172,7 +172,7 @@ async def post_award(award_list: AwardList, token: str = Depends(oauth2_scheme)) status_code=404, detail=f"Team ID {x.team_id} not found" ) - new_awards.append(x.dict()) + new_awards.append(x.model_dump()) with db.atomic(): for batch in chunked(new_awards, 15): diff --git a/app/routers_v3/battingstats.py b/app/routers_v3/battingstats.py index df88a3f..7a6db22 100644 --- a/app/routers_v3/battingstats.py +++ b/app/routers_v3/battingstats.py @@ -366,7 +366,9 @@ async def patch_batstats( if BattingStat.get_or_none(BattingStat.id == stat_id) is None: raise HTTPException(status_code=404, detail=f"Stat ID {stat_id} not found") - BattingStat.update(**new_stats.dict()).where(BattingStat.id == stat_id).execute() + BattingStat.update(**new_stats.model_dump()).where( + BattingStat.id == stat_id + ).execute() r_stat = model_to_dict(BattingStat.get_by_id(stat_id)) return r_stat @@ -403,7 +405,7 @@ async def post_batstats(s_list: BatStatList, token: str = Depends(oauth2_scheme) status_code=404, detail=f"Player ID {x.player_id} not found" ) - all_stats.append(BattingStat(**x.dict())) + all_stats.append(BattingStat(**x.model_dump())) with db.atomic(): for batch in chunked(all_stats, 15): diff --git a/app/routers_v3/current.py b/app/routers_v3/current.py index 889c38a..294a1ba 100644 --- a/app/routers_v3/current.py +++ b/app/routers_v3/current.py @@ -113,7 +113,7 @@ async def post_current(new_current: CurrentModel, token: str = Depends(oauth2_sc logger.warning(f"patch_current - Bad Token: {token}") raise HTTPException(status_code=401, detail="Unauthorized") - this_current = Current(**new_current.dict()) + this_current = Current(**new_current.model_dump()) if this_current.save(): r_curr = model_to_dict(this_current) diff --git a/app/routers_v3/decisions.py b/app/routers_v3/decisions.py index 98b52c9..af008c8 100644 --- a/app/routers_v3/decisions.py +++ b/app/routers_v3/decisions.py @@ -217,7 +217,7 @@ async def post_decisions(dec_list: DecisionList, token: str = Depends(oauth2_sch status_code=404, detail=f"Player ID {x.pitcher_id} not found" ) - new_dec.append(x.dict()) + new_dec.append(x.model_dump()) with db.atomic(): for batch in chunked(new_dec, 10): diff --git a/app/routers_v3/divisions.py b/app/routers_v3/divisions.py index 39f721f..d76f788 100644 --- a/app/routers_v3/divisions.py +++ b/app/routers_v3/divisions.py @@ -118,7 +118,7 @@ async def post_division( logger.warning(f"post_division - Bad Token: {token}") raise HTTPException(status_code=401, detail="Unauthorized") - this_division = Division(**new_division.dict()) + this_division = Division(**new_division.model_dump()) if this_division.save() == 1: r_division = model_to_dict(this_division) diff --git a/app/routers_v3/draftlist.py b/app/routers_v3/draftlist.py index 8d544d7..ab25057 100644 --- a/app/routers_v3/draftlist.py +++ b/app/routers_v3/draftlist.py @@ -98,7 +98,7 @@ async def post_draftlist( DraftList.delete().where(DraftList.team == this_team).execute() for x in draft_list.draft_list: - new_list.append(x.dict()) + new_list.append(x.model_dump()) with db.atomic(): for batch in chunked(new_list, 15): diff --git a/app/routers_v3/draftpicks.py b/app/routers_v3/draftpicks.py index 3524404..5eaceb5 100644 --- a/app/routers_v3/draftpicks.py +++ b/app/routers_v3/draftpicks.py @@ -150,7 +150,7 @@ async def patch_pick( if DraftPick.get_or_none(DraftPick.id == pick_id) is None: raise HTTPException(status_code=404, detail=f"Pick ID {pick_id} not found") - DraftPick.update(**new_pick.dict()).where(DraftPick.id == pick_id).execute() + DraftPick.update(**new_pick.model_dump()).where(DraftPick.id == pick_id).execute() r_pick = model_to_dict(DraftPick.get_by_id(pick_id)) return r_pick @@ -173,7 +173,7 @@ async def post_picks(p_list: DraftPickList, token: str = Depends(oauth2_scheme)) detail=f"Pick # {pick.overall} already exists for season {pick.season}", ) - new_picks.append(pick.dict()) + new_picks.append(pick.model_dump()) with db.atomic(): for batch in chunked(new_picks, 15): diff --git a/app/routers_v3/injuries.py b/app/routers_v3/injuries.py index 730378c..ab5a8a7 100644 --- a/app/routers_v3/injuries.py +++ b/app/routers_v3/injuries.py @@ -112,7 +112,7 @@ async def post_injury(new_injury: InjuryModel, token: str = Depends(oauth2_schem logger.warning(f"post_injury - Bad Token: {token}") raise HTTPException(status_code=401, detail="Unauthorized") - this_injury = Injury(**new_injury.dict()) + this_injury = Injury(**new_injury.model_dump()) if this_injury.save(): r_injury = model_to_dict(this_injury) diff --git a/app/routers_v3/keepers.py b/app/routers_v3/keepers.py index ad8d4e7..4ffd5d7 100644 --- a/app/routers_v3/keepers.py +++ b/app/routers_v3/keepers.py @@ -100,7 +100,7 @@ async def post_keepers(k_list: KeeperList, token: str = Depends(oauth2_scheme)): new_keepers = [] for keeper in k_list.keepers: - new_keepers.append(keeper.dict()) + new_keepers.append(keeper.model_dump()) with db.atomic(): for batch in chunked(new_keepers, 14): diff --git a/app/routers_v3/managers.py b/app/routers_v3/managers.py index 0e24c5f..45ce18c 100644 --- a/app/routers_v3/managers.py +++ b/app/routers_v3/managers.py @@ -143,7 +143,7 @@ async def post_manager(new_manager: ManagerModel, token: str = Depends(oauth2_sc logger.warning(f"post_manager - Bad Token: {token}") raise HTTPException(status_code=401, detail="Unauthorized") - this_manager = Manager(**new_manager.dict()) + this_manager = Manager(**new_manager.model_dump()) if this_manager.save(): r_manager = model_to_dict(this_manager) diff --git a/app/routers_v3/pitchingstats.py b/app/routers_v3/pitchingstats.py index a61003a..1c65e2f 100644 --- a/app/routers_v3/pitchingstats.py +++ b/app/routers_v3/pitchingstats.py @@ -317,7 +317,9 @@ async def patch_pitstats( if PitchingStat.get_or_none(PitchingStat.id == stat_id) is None: raise HTTPException(status_code=404, detail=f"Stat ID {stat_id} not found") - PitchingStat.update(**new_stats.dict()).where(PitchingStat.id == stat_id).execute() + PitchingStat.update(**new_stats.model_dump()).where( + PitchingStat.id == stat_id + ).execute() r_stat = model_to_dict(PitchingStat.get_by_id(stat_id)) return r_stat @@ -343,7 +345,7 @@ async def post_pitstats(s_list: PitStatList, token: str = Depends(oauth2_scheme) status_code=404, detail=f"Player ID {x.player_id} not found" ) - all_stats.append(PitchingStat(**x.dict())) + all_stats.append(PitchingStat(**x.model_dump())) with db.atomic(): for batch in chunked(all_stats, 15): diff --git a/app/routers_v3/results.py b/app/routers_v3/results.py index 8b7298b..256235d 100644 --- a/app/routers_v3/results.py +++ b/app/routers_v3/results.py @@ -183,7 +183,7 @@ async def post_results(result_list: ResultList, token: str = Depends(oauth2_sche status_code=404, detail=f"Team ID {x.hometeam_id} not found" ) - new_results.append(x.dict()) + new_results.append(x.model_dump()) with db.atomic(): for batch in chunked(new_results, 15): diff --git a/app/routers_v3/sbaplayers.py b/app/routers_v3/sbaplayers.py index 255894f..d4f8b81 100644 --- a/app/routers_v3/sbaplayers.py +++ b/app/routers_v3/sbaplayers.py @@ -236,7 +236,7 @@ async def post_one_player(player: SbaPlayerModel, token: str = Depends(oauth2_sc detail=f"{player.first_name} {player.last_name} has a key already in the database", ) - new_player = SbaPlayer(**player.dict()) + new_player = SbaPlayer(**player.model_dump()) saved = new_player.save() if saved == 1: return_val = model_to_dict(new_player) diff --git a/app/routers_v3/schedules.py b/app/routers_v3/schedules.py index 59924fe..3e9b03d 100644 --- a/app/routers_v3/schedules.py +++ b/app/routers_v3/schedules.py @@ -168,7 +168,7 @@ async def post_schedules(sched_list: ScheduleList, token: str = Depends(oauth2_s status_code=404, detail=f"Team ID {x.hometeam_id} not found" ) - new_sched.append(x.dict()) + new_sched.append(x.model_dump()) with db.atomic(): for batch in chunked(new_sched, 15): diff --git a/app/routers_v3/stratgame.py b/app/routers_v3/stratgame.py index 7f42773..2604751 100644 --- a/app/routers_v3/stratgame.py +++ b/app/routers_v3/stratgame.py @@ -250,7 +250,7 @@ async def post_games(game_list: GameList, token: str = Depends(oauth2_scheme)) - status_code=404, detail=f"Team ID {x.home_team_id} not found" ) - new_games.append(x.dict()) + new_games.append(x.model_dump()) with db.atomic(): for batch in chunked(new_games, 16): diff --git a/app/routers_v3/stratplay/crud.py b/app/routers_v3/stratplay/crud.py index dde61f7..0c26b33 100644 --- a/app/routers_v3/stratplay/crud.py +++ b/app/routers_v3/stratplay/crud.py @@ -37,7 +37,7 @@ async def patch_play( if StratPlay.get_or_none(StratPlay.id == play_id) is None: raise HTTPException(status_code=404, detail=f"Play ID {play_id} not found") - StratPlay.update(**new_play.dict()).where(StratPlay.id == play_id).execute() + StratPlay.update(**new_play.model_dump()).where(StratPlay.id == play_id).execute() r_play = model_to_dict(StratPlay.get_by_id(play_id)) return r_play @@ -84,7 +84,7 @@ async def post_plays(p_list: PlayList, token: str = Depends(oauth2_scheme)): if this_play.pa == 0: this_play.batter_final = None - new_plays.append(this_play.dict()) + new_plays.append(this_play.model_dump()) with db.atomic(): for batch in chunked(new_plays, 20): diff --git a/app/routers_v3/transactions.py b/app/routers_v3/transactions.py index ee02de8..6945167 100644 --- a/app/routers_v3/transactions.py +++ b/app/routers_v3/transactions.py @@ -172,7 +172,7 @@ async def post_transactions( status_code=404, detail=f"Player ID {x.player_id} not found" ) - all_moves.append(x.dict()) + all_moves.append(x.model_dump()) with db.atomic(): for batch in chunked(all_moves, 15):