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: sqlalchemy.Column[uuid.UUID][source]
list_id: sqlalchemy.Column[str][source]
number_of_mandates: sqlalchemy.Column[int][source]
name: sqlalchemy.Column[str][source]
election_id: sqlalchemy.Column[str][source]
election: sqlalchemy.orm.relationship[onegov.election_day.models.ProporzElection][source]
connection_id: sqlalchemy.Column[uuid.UUID | None][source]
connection: sqlalchemy.orm.relationship[onegov.election_day.models.ListConnection][source]
candidates: sqlalchemy.orm.relationship[list[onegov.election_day.models.Candidate]][source]
results: sqlalchemy.orm.relationship[list[onegov.election_day.models.election.list_result.ListResult]][source]
panachage_results: sqlalchemy.orm.relationship[list[onegov.election_day.models.ListPanachageResult]][source]
panachage_results_lost: sqlalchemy.orm.relationship[list[onegov.election_day.models.ListPanachageResult]][source]
candidate_panachage_results: sqlalchemy.orm.relationship[list[onegov.election_day.models.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) sqlalchemy.sql.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.