Utilisation du code d'arrondissement pour importer les communes

This commit is contained in:
2024-06-13 11:31:23 +02:00
parent a20411b409
commit 2b10c4c7b2

View File

@ -80,7 +80,7 @@ def importer_communes(engine: Engine, debug: bool = False) -> None:
with Session(engine) as session:
for feature in features:
commune_dict = feature['properties']
code_commune = commune_dict['com_code'][0]
code_commune = commune_dict['com_arm_code'][0]
nom_commune = commune_dict['com_name'][0]
if commune := session.execute(select(Commune).filter_by(code_insee=code_commune)).scalar_one_or_none():