Skip to content
Snippets Groups Projects
Commit c96a5047 authored by Martin Mareš's avatar Martin Mareš
Browse files

Import škol: první chodivá verze

parent d46f5056
Branches
No related tags found
No related merge requests found
...@@ -56,7 +56,25 @@ def import_schools(path: Path, nuts: str): ...@@ -56,7 +56,25 @@ def import_schools(path: Path, nuts: str):
# print(f"WARNING: Škola má dvě různé adresy: <{addr}> != <{addr2}>", file=sys.stderr) # print(f"WARNING: Škola má dvě různé adresy: <{addr}> != <{addr2}>", file=sys.stderr)
town = lookup_town(misto2, nuts) town = lookup_town(misto2, nuts)
print(town)
if druh.startswith('Základní škola'):
stype = db.SchoolType.zs
elif druh.startswith('Střední škola'):
stype = db.SchoolType.ss
else:
assert False, f"Neznámý druh školy: {druh}"
school = db.School(
level=4,
parent=town.place_id,
name=nazev,
type=db.PlaceType.school,
red_izo=red_izo,
izo=izo,
official_name=nazev,
address=addr2,
stype=stype)
session.add(school)
global new_school_cnt global new_school_cnt
new_school_cnt += 1 new_school_cnt += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment