ballot.models.election.list

Module Contents

Classes

List

A list.

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

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

A list.

property percentage_by_entity: dict[int, onegov.ballot.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.ballot.types.DistrictPercentage][source]

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

__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[source]
panachage_results_lost: relationship[list[ListPanachageResult]][source]
panachage_results_lost[source]
candidate_panachage_results: relationship[list[CandidatePanachageResult]][source]
candidate_panachage_results[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.