Export données législatives 2024

This commit is contained in:
2024-06-20 16:05:24 +02:00
parent 7aa92d28d4
commit df8c8db32d
4 changed files with 526 additions and 46 deletions

View File

@ -297,7 +297,8 @@ def importer_resultats_commune(engine: Engine, verbose: bool = False) -> None:
.scalar_one_or_none()
if not voix_nuance_commune:
voix_nuance_commune = VoixCommuneLegislatives2022(resultats_commune_id=resultats_commune.id,
nuance_id=nuance_code)
nuance_id=nuance_code,
voix_t1=0, voix_t2=0)
session.add(voix_nuance_commune)
if tour == 1:
@ -305,7 +306,7 @@ def importer_resultats_commune(engine: Engine, verbose: bool = False) -> None:
elif tour == 2:
voix_nuance_commune.voix_t2 += voix
session.commit()
session.commit()
def importer_resultats_circo(engine: Engine, verbose: bool = False) -> None: