election_day.collections.notifications

Module Contents

Classes

NotificationCollection

class election_day.collections.notifications.NotificationCollection(session: sqlalchemy.orm.Session)[source]
query() Query[Notification][source]
by_model(model: onegov.ballot.Election | onegov.ballot.ElectionCompound | onegov.ballot.Vote, current: bool = True) list[onegov.election_day.models.Notification][source]

Returns the notification for the given election or vote and its modification times. Only returns the current by default.

trigger(request: onegov.election_day.request.ElectionDayRequest, model: onegov.ballot.Election | onegov.ballot.ElectionCompound | onegov.ballot.Vote, options: Collection[str]) None[source]

Triggers and adds the selected notifications.

trigger_summarized(request: onegov.election_day.request.ElectionDayRequest, elections: Sequence[Election], election_compounds: Sequence[ElectionCompound], votes: Sequence[Vote], options: Collection[str]) None[source]

Triggers and adds a single notification for all given votes and elections.