ballot.models.election_compound.mixins

Module Contents

Classes

ResultRow

TotalRow

DerivedAttributesMixin

A simple mixin to add commonly used functions to election compounds

Attributes

Elections

ballot.models.election_compound.mixins.Elections: typing_extensions.TypeAlias[source]
class ballot.models.election_compound.mixins.ResultRow[source]

Bases: NamedTuple

domain_segment: str[source]
domain_supersegment: str[source]
counted: bool[source]
turnout: float[source]
eligible_voters: int[source]
expats: int[source]
received_ballots: int[source]
accounted_ballots: int[source]
blank_ballots: int[source]
invalid_ballots: int[source]
accounted_votes: int[source]
class ballot.models.election_compound.mixins.TotalRow[source]

Bases: NamedTuple

turnout: float[source]
eligible_voters: int[source]
expats: int[source]
received_ballots: int[source]
accounted_ballots: int[source]
blank_ballots: int[source]
invalid_ballots: int[source]
accounted_votes: int[source]
class ballot.models.election_compound.mixins.DerivedAttributesMixin[source]

A simple mixin to add commonly used functions to election compounds and parts.

Requires an elections and session attribute.

property number_of_mandates: int[source]

The (total) number of mandates.

property allocated_mandates: int[source]

Number of already allocated mandates/elected candidates.

property completed: bool[source]

Returns True, if all elections are completed.

property counted: bool[source]

True if all elections have been counted.

property counted_entities: list[str | None][source]
property results: list[ResultRow][source]
property totals: TotalRow[source]