election_day.utils.notification

Attributes

DomainSubset

Classes

ModelGroup

Functions

segment_models(→ list[ModelGroup])

Group elections, compounds and votes by subscribable notification

Module Contents

election_day.utils.notification.DomainSubset: TypeAlias = Literal['canton', 'municipality'] | None[source]
class election_day.utils.notification.ModelGroup[source]

Bases: NamedTuple

domain: DomainSubset[source]
domain_segment: str | None[source]
elections: collections.abc.Sequence[onegov.election_day.models.Election][source]
election_compounds: collections.abc.Sequence[onegov.election_day.models.ElectionCompound][source]
votes: collections.abc.Sequence[onegov.election_day.models.Vote][source]
filter: sqlalchemy.sql.ColumnElement[bool][source]
election_day.utils.notification.segment_models(elections: collections.abc.Sequence[onegov.election_day.models.Election], election_compounds: collections.abc.Sequence[onegov.election_day.models.ElectionCompound], votes: collections.abc.Sequence[onegov.election_day.models.Vote]) list[ModelGroup][source]

Group elections, compounds and votes by subscribable notification segmenation.