1. добавил в админку сортировку игроков и Фото (если галочка стоит, то путь к фото генерируется автоматически)

2. фото обновляются прям в json
This commit is contained in:
2026-06-22 15:31:07 +03:00
parent cd370cf04f
commit f63061a06d
10 changed files with 620 additions and 98 deletions

View File

@@ -13,7 +13,9 @@ def get_match_lineups_grouped(match_id: int, home_team_id: int, away_team_id: in
ml.is_captain,
p.last_name,
p.first_name,
p.position as pos
p.position as pos,
p.photo,
COALESCE(p.photo_enabled, FALSE) AS photo_enabled
FROM match_lineups ml
LEFT JOIN players p ON p.id = ml.player_id
WHERE ml.match_id = %s;
@@ -46,10 +48,13 @@ def get_match_lineups_grouped(match_id: int, home_team_id: int, away_team_id: in
last_name,
first_name,
pos,
photo,
photo_enabled,
) = row
item = {
"player_id": player_id,
"team_id": team_id,
"number": number or "",
"last_name": last_name or "",
"first_name": first_name or "",
@@ -57,6 +62,8 @@ def get_match_lineups_grouped(match_id: int, home_team_id: int, away_team_id: in
"position": position or "",
"is_captain": bool(is_captain),
"pos": pos,
"photo": photo or "",
"photo_enabled": bool(photo_enabled),
}
if team_id == home_team_id and lineup_type == "starting":