From 28c315f64aab93c8dc6c7d77e9eb468196ceae57 Mon Sep 17 00:00:00 2001 From: David Salvisberg <david.salvisberg@seantis.ch> Date: Fri, 2 Aug 2024 08:42:45 +0200 Subject: [PATCH] Fixes ambiguous model name in relationship --- src/onegov/election_day/models/election/election.py | 5 +++-- .../models/election_compound/election_compound.py | 5 +++-- src/onegov/election_day/models/vote/vote.py | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/onegov/election_day/models/election/election.py b/src/onegov/election_day/models/election/election.py index e927d8c805..8655a229a4 100644 --- a/src/onegov/election_day/models/election/election.py +++ b/src/onegov/election_day/models/election/election.py @@ -392,8 +392,9 @@ def clear_results(self, clear_all: bool = False) -> None: ) #: notifcations linked to this election - notifications: 'relationship[AppenderQuery[Notification]]' = relationship( - 'Notification', + notifications: 'relationship[AppenderQuery[Notification]]' + notifications = relationship( # type:ignore[misc] + 'onegov.election_day.models.notification.Notification', back_populates='election', lazy='dynamic' ) diff --git a/src/onegov/election_day/models/election_compound/election_compound.py b/src/onegov/election_day/models/election_compound/election_compound.py index fb5ae9096e..2283604fed 100644 --- a/src/onegov/election_day/models/election_compound/election_compound.py +++ b/src/onegov/election_day/models/election_compound/election_compound.py @@ -233,8 +233,9 @@ def elected_candidates(self) -> list[tuple[str, str]]: return result #: notifcations linked to this election compound - notifications: 'relationship[AppenderQuery[Notification]]' = relationship( - 'Notification', + notifications: 'relationship[AppenderQuery[Notification]]' + notifications = relationship( # type:ignore[misc] + 'onegov.election_day.models.notification.Notification', back_populates='election_compound', lazy='dynamic' ) diff --git a/src/onegov/election_day/models/vote/vote.py b/src/onegov/election_day/models/vote/vote.py index acbd350d8b..a6dc46f902 100644 --- a/src/onegov/election_day/models/vote/vote.py +++ b/src/onegov/election_day/models/vote/vote.py @@ -316,8 +316,9 @@ def last_modified(cls) -> 'ColumnElement[datetime.datetime | None]': ) #: notifcations linked to this vote - notifications: 'relationship[AppenderQuery[Notification]]' = relationship( - 'Notification', + notifications: 'relationship[AppenderQuery[Notification]]' + notifications = relationship( # type:ignore[misc] + 'onegov.election_day.models.notification.Notification', back_populates='vote', lazy='dynamic' )