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: Sequence[Election][source]
election_compounds: Sequence[ElectionCompound][source]
votes: Sequence[Vote][source]
filter: ColumnElement[bool][source]
election_day.utils.notification.segment_models(elections: Sequence[Election], election_compounds: Sequence[ElectionCompound], votes: Sequence[Vote]) list[ModelGroup][source]

Group elections, compounds and votes by subscribable notification segmenation.