election_day.models.election.election
Classes
Mixin providing a meta/content JSON pair. Meta is a JSON column loaded |
Module Contents
- class election_day.models.election.election.Election[source]
Bases:
onegov.core.orm.Base
,onegov.core.orm.mixins.ContentMixin
,onegov.election_day.models.mixins.LastModifiedMixin
,onegov.election_day.models.mixins.DomainOfInfluenceMixin
,onegov.election_day.models.mixins.StatusMixin
,onegov.election_day.models.mixins.TitleTranslationsMixin
,onegov.election_day.models.mixins.IdFromTitlesMixin
,onegov.election_day.models.election.mixins.DerivedAttributesMixin
,onegov.election_day.models.mixins.ExplanationsPdfMixin
,onegov.election_day.models.party_result.mixins.PartyResultsOptionsMixin
Mixin providing a meta/content JSON pair. Meta is a JSON column loaded with each request, content is a JSON column loaded deferred (to be shown only in the detail view).
- title_observer(title_translations: collections.abc.Mapping[str, str], short_title_translations: collections.abc.Mapping[str, str]) None [source]
- property progress: tuple[int, int][source]
Returns a tuple with the first value being the number of counted election results and the second value being the number of total results.
- property counted_entities: list[str][source]
Returns the names of the already counted entities.
Might contain an empty string in case of expats.
- candidates: sqlalchemy.orm.relationship[list[onegov.election_day.models.election.candidate.Candidate]][source]
- results: sqlalchemy.orm.relationship[list[onegov.election_day.models.election.election_result.ElectionResult]][source]
- property results_query: sqlalchemy.orm.Query[onegov.election_day.models.election.election_result.ElectionResult][source]
- referencing_elections: sqlalchemy.orm.relationship[onegov.core.types.AppenderQuery[onegov.election_day.models.ElectionRelationship]][source]
- election_compound: sqlalchemy.orm.relationship[onegov.election_day.models.ElectionCompound][source]
- property completed: bool[source]
Overwrites StatusMixin’s ‘completed’ for compounds with manual completion.
- 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 elected_candidates: list[tuple[str, str]][source]
Returns the first and last names of the elected candidates.
- property votes_by_district: sqlalchemy.orm.Query[VotesByDistrictRow][source]