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: sqlalchemy.Column[uuid.UUID][source]
candidate_id: sqlalchemy.Column[str][source]
family_name: sqlalchemy.Column[str][source]
first_name: sqlalchemy.Column[str][source]
elected: sqlalchemy.Column[bool][source]
gender: sqlalchemy.Column[onegov.election_day.types.Gender | None][source]
year_of_birth: sqlalchemy.Column[int | None][source]
election_id: sqlalchemy.Column[str][source]
election: sqlalchemy.orm.relationship[onegov.election_day.models.Election][source]
list_id: sqlalchemy.Column[uuid.UUID | None][source]
list: sqlalchemy.orm.relationship[onegov.election_day.models.List][source]
party: sqlalchemy.Column[str | None][source]
results: sqlalchemy.orm.relationship[list_t[onegov.election_day.models.election.candidate_result.CandidateResult]][source]
panachage_results: sqlalchemy.orm.relationship[list_t[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.