diff --git a/classes/election_cycle.py b/classes/election_cycle.py index b45f44d..057425f 100644 --- a/classes/election_cycle.py +++ b/classes/election_cycle.py @@ -206,3 +206,17 @@ class ElectionCycle: """ return f"{self.election_start.year} {self.elecion_cycle.name} election" + + def get_election_info(self) -> ElectionInformation: + """ + Gets information for current election. + + Returns: + ElectionInformation: The information from the database about the current election. + """ + + with Session(engine) as session: + stmt = select(ElectionInformation).where( + ElectionInformation.ElectionCycle == self.get_election_cycle_name() + ) + return session.scalar(stmt)