Renommage des modèles pour les européennes
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
from typing import List
|
||||
|
||||
from sqlalchemy import Float, ForeignKey, Integer, JSON, String
|
||||
from sqlalchemy import ForeignKey, Integer, JSON, String
|
||||
from sqlalchemy.orm import mapped_column, Mapped, relationship
|
||||
|
||||
from nupes.models import Base
|
||||
@ -15,7 +15,7 @@ class Region(Base):
|
||||
|
||||
departements: Mapped[List["Departement"]] = relationship("Departement", back_populates="region")
|
||||
|
||||
resultats2024 = relationship("ResultatsRegion", back_populates="region")
|
||||
resultats_europeennes_2024 = relationship("ResultatsRegionEuropeennes2024", back_populates="region")
|
||||
|
||||
|
||||
class Departement(Base):
|
||||
@ -30,7 +30,7 @@ class Departement(Base):
|
||||
circonscriptions: Mapped[List["Circonscription"]] = relationship("Circonscription", back_populates="departement")
|
||||
communes: Mapped[List["Commune"]] = relationship("Commune", back_populates="departement")
|
||||
|
||||
resultats2024 = relationship("ResultatsDepartement", back_populates="departement")
|
||||
resultats_europeennes_2024 = relationship("ResultatsDepartementEuropeennes2024", back_populates="departement")
|
||||
|
||||
|
||||
class Commune(Base):
|
||||
@ -44,7 +44,7 @@ class Commune(Base):
|
||||
departement: Mapped[Departement] = relationship(Departement, back_populates="communes")
|
||||
bureaux_vote: Mapped[List["BureauVote"]] = relationship("BureauVote", back_populates="commune")
|
||||
|
||||
resultats2024 = relationship("ResultatsCommune", back_populates="commune")
|
||||
resultats_europeennes_2024 = relationship("ResultatsCommuneEuropeennes2024", back_populates="commune")
|
||||
|
||||
|
||||
class Circonscription(Base):
|
||||
@ -58,7 +58,8 @@ class Circonscription(Base):
|
||||
departement: Mapped[Departement] = relationship(Departement, back_populates="circonscriptions")
|
||||
bureaux_vote: Mapped[List["BureauVote"]] = relationship("BureauVote", back_populates="circonscription")
|
||||
|
||||
resultats2024 = relationship("ResultatsCirconscription", back_populates="circonscription")
|
||||
resultats_europeennes_2024 = relationship("ResultatsCirconscriptionEuropeennes2024",
|
||||
back_populates="circonscription")
|
||||
|
||||
|
||||
class BureauVote(Base):
|
||||
@ -75,4 +76,4 @@ class BureauVote(Base):
|
||||
commune: Mapped[Commune] = relationship(Commune, back_populates="bureaux_vote")
|
||||
circonscription: Mapped[Circonscription] = relationship(Circonscription, back_populates="bureaux_vote")
|
||||
|
||||
resultats2024 = relationship("ResultatsBureauVote", back_populates="bureau_vote")
|
||||
resultats_europeennes_2024 = relationship("ResultatsBureauVoteEuropeennes2024", back_populates="bureau_vote")
|
||||
|
Reference in New Issue
Block a user