From 99f82a268af3e2e4e4484c93a1cc29b4a10e4e01 Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Sat, 21 Jun 2025 16:53:25 +0200
Subject: [PATCH] =?UTF-8?q?export-pion:=20U=20=C5=A1kol=20uv=C3=A1d=C3=ADm?=
 =?UTF-8?q?e=20RED=5FIZO?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 bin/export-pion | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/export-pion b/bin/export-pion
index 55460b4a..9df71e79 100755
--- a/bin/export-pion
+++ b/bin/export-pion
@@ -33,6 +33,7 @@ res = (sess.query(db.Participant, db.Participation, db.Contest, db.Round)
        .join(db.Round, and_(db.Round.round_id == db.Contest.round_id, db.Round.year == db.Participant.year))
        .options(joinedload(db.Participant.user))
        .options(joinedload(db.Participant.school_place).joinedload(db.Place.parent_place).joinedload(db.Place.parent_place).joinedload(db.Place.parent_place))
+       .options(joinedload(db.Participant.school_place).joinedload(db.Place.school))
        .options(joinedload(db.Participation.place))
        .filter(db.Round.master_round_id == db.Round.round_id)
        .filter(db.Participation.state == db.PartState.active)
@@ -52,6 +53,7 @@ class Row(mo.csv.Row):
     trida: str = ""
     nazev_skoly: str = ""
     id_skoly: str = ""
+    izo_skoly: str = ""
     mesto_skoly: str = ""
     okres_skoly: str = ""
     kraj_skoly: str = ""
@@ -79,6 +81,7 @@ for pant, pion, ct, rnd in res:
         trida=pant.grade,
         nazev_skoly=pant.school_place.name,
         id_skoly=str(pant.school),
+        izo_skoly=pant.school_place.school.red_izo or "",
         mesto_skoly=pant.school_place.parent_place.name,
         okres_skoly=pant.school_place.parent_place.parent_place.name,
         kraj_skoly=pant.school_place.parent_place.parent_place.parent_place.name,
-- 
GitLab