Add gauntlet_id to /games
This commit is contained in:
parent
e4d2e432dd
commit
aca7d6df23
@ -46,7 +46,8 @@ async def get_games(
|
||||
season: list = Query(default=None), forfeit: Optional[bool] = None, away_team_id: list = Query(default=None),
|
||||
home_team_id: list = Query(default=None), team1_id: list = Query(default=None),
|
||||
team2_id: list = Query(default=None), game_type: list = Query(default=None), ranked: Optional[bool] = None,
|
||||
short_game: Optional[bool] = None, csv: Optional[bool] = False, short_output: bool = False):
|
||||
short_game: Optional[bool] = None, csv: Optional[bool] = False, short_output: bool = False,
|
||||
gauntlet_id: Optional[int] = None):
|
||||
all_games = StratGame.select()
|
||||
|
||||
if season is not None:
|
||||
@ -72,6 +73,8 @@ async def get_games(
|
||||
all_games = all_games.where(StratGame.ranked == ranked)
|
||||
if short_game is not None:
|
||||
all_games = all_games.where(StratGame.short_game == short_game)
|
||||
if gauntlet_id is not None:
|
||||
all_games = all_games.where(StratGame.game_type.contains(f'gauntlet-{gauntlet_id}'))
|
||||
|
||||
if csv:
|
||||
return_vals = [model_to_dict(x) for x in all_games]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user