Updated lineup string
This commit is contained in:
parent
8b8fa65023
commit
579bde6c03
@ -230,15 +230,21 @@ class Game(SQLModel, table=True):
|
|||||||
return new_play
|
return new_play
|
||||||
|
|
||||||
def team_lineup(self, session: Session, team: Team, with_links: bool = True) -> str:
|
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 = ''
|
lineup_val = ''
|
||||||
for line in all_lineups:
|
for line in all_lineups:
|
||||||
if with_links:
|
if with_links:
|
||||||
name_string = {line.player.name_card_link("batting" if line.position != "P" else "pitching")}
|
name_string = {line.player.name_card_link("batting" if line.position != "P" else "pitching")}
|
||||||
else:
|
else:
|
||||||
name_string = {line.player.name_with_desc}
|
name_string = f'{line.player.name_with_desc}'
|
||||||
lineup_val += f'{line.batting_order}. {name_string} {line.position}\n'
|
|
||||||
|
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
|
return lineup_val
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user