election_day.models.election.candidate

Attributes

list_t

Classes

Candidate

A candidate.

Module Contents

election_day.models.election.candidate.list_t[source]
class election_day.models.election.candidate.Candidate[source]

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

A candidate.

__tablename__ = 'candidates'[source]
id: Column[uuid.UUID][source]
candidate_id: Column[str][source]
family_name: Column[str][source]
first_name: Column[str][source]
elected: Column[bool][source]
gender: Column[Gender | None][source]
year_of_birth: Column[int | None][source]
election_id: Column[str][source]
election: relationship[Election][source]
list_id: Column[uuid.UUID | None][source]
list: relationship[List][source]
party: Column[str | None][source]
results: relationship[list_t[CandidateResult]][source]
panachage_results: relationship[list_t[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.