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: Mapping[str, str], short_title_translations: 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.
- results: relationship[list[ElectionResult]][source]
- property results_query: Query[ElectionResult][source]
- referencing_elections: relationship[AppenderQuery[ElectionRelationship]][source]
- election_compound: relationship[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) 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: Query[VotesByDistrictRow][source]
- data_sources: relationship[list[DataSourceItem]][source]
- notifications: relationship[AppenderQuery[Notification]][source]