election_day.models.election.list

Classes

List

A list.

Module Contents

class election_day.models.election.list.List[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.TimestampMixin

A list.

__tablename__ = 'lists'[source]
id: Column[uuid.UUID][source]
list_id: Column[str][source]
number_of_mandates: Column[int][source]
name: Column[str][source]
election_id: Column[str][source]
election: relationship[ProporzElection][source]
connection_id: Column[uuid.UUID | None][source]
connection: relationship[ListConnection][source]
candidates: relationship[list[Candidate]][source]
results: relationship[list[ListResult]][source]
panachage_results: relationship[list[ListPanachageResult]][source]
panachage_results_lost: relationship[list[ListPanachageResult]][source]
candidate_panachage_results: relationship[list[CandidatePanachageResult]][source]
votes[source]
aggregate_results(attribute: str) int[source]

Gets the sum of the given attribute from the results.

classmethod aggregate_results_expression(attribute: str) ColumnElement[int][source]

Gets the sum of the given attribute from the results, as SQL expression.

property percentage_by_entity: dict[int, onegov.election_day.types.EntityPercentage][source]

Returns the percentage of votes by the entity. Includes uncounted entities and entities with no results available.

property percentage_by_district: dict[str, onegov.election_day.types.DistrictPercentage][source]

Returns the percentage of votes aggregated by the distict. Includes uncounted districts and districts with no results available.