Updated lineup string
This commit is contained in:
parent
8b8fa65023
commit
579bde6c03
@ -230,15 +230,21 @@ class Game(SQLModel, table=True):
|
||||
return new_play
|
||||
|
||||
def team_lineup(self, session: Session, team: Team, with_links: bool = True) -> str:
|
||||
all_lineups = session.exec(select(Lineup).where(Lineup.team == team, Lineup.game == self).order_by(Lineup.batting_order)).all()
|
||||
all_lineups = session.exec(select(Lineup).where(Lineup.team == team, Lineup.game == self, Lineup.active).order_by(Lineup.batting_order)).all()
|
||||
|
||||
lineup_val = ''
|
||||
for line in all_lineups:
|
||||
if with_links:
|
||||
name_string = {line.player.name_card_link("batting" if line.position != "P" else "pitching")}
|
||||
else:
|
||||
name_string = {line.player.name_with_desc}
|
||||
lineup_val += f'{line.batting_order}. {name_string} {line.position}\n'
|
||||
name_string = f'{line.player.name_with_desc}'
|
||||
|
||||
if line.position == 'P':
|
||||
this_hand = line.card.pitcherscouting.pitchingcard.hand
|
||||
else:
|
||||
this_hand = line.card.batterscouting.battingcard.hand
|
||||
|
||||
lineup_val += f'{line.batting_order}. {this_hand.upper()} | {name_string}, {line.position}\n'
|
||||
|
||||
return lineup_val
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user