election_day.models.election_compound.election_compound

Attributes

rel

Classes

ElectionCompound

Mixin providing a meta/content JSON pair. Meta is a JSON column loaded

Module Contents

election_day.models.election_compound.election_compound.rel[source]
class election_day.models.election_compound.election_compound.ElectionCompound[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.TitleTranslationsMixin, onegov.election_day.models.mixins.IdFromTitlesMixin, onegov.election_day.models.party_result.mixins.PartyResultsOptionsMixin, onegov.election_day.models.party_result.mixins.PartyResultsCheckMixin, onegov.election_day.models.party_result.mixins.HistoricalPartyResultsMixin, onegov.election_day.models.mixins.ExplanationsPdfMixin, onegov.election_day.models.election_compound.mixins.DerivedAttributesMixin

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).

__tablename__ = 'election_compounds'[source]
property polymorphic_base: type[ElectionCompound][source]
id: Column[str][source]
external_id: Column[str | None][source]
title_translations: Column[Mapping[str, str]][source]
title[source]
short_title_translations: Column[Mapping[str, str] | None][source]
short_title[source]
title_observer(title_translations: Mapping[str, str], short_title_translations: Mapping[str, str]) None[source]
shortcode: Column[str | None][source]
date: Column[datetime.date][source]
pukelsheim: Column[bool][source]
completes_manually: Column[bool][source]
manually_completed: Column[bool][source]
party_results: relationship[list[PartyResult]][source]
party_panachage_results: rel[list[PartyPanachageResult]][source]
party_panachage_results[source]
related_compounds: rel[AppenderQuery[ElectionCompoundRelationship]][source]
related_compounds[source]
referencing_compounds: rel[AppenderQuery[ElectionCompoundRelationship]][source]
referencing_compounds[source]
colors: onegov.core.orm.mixins.dict_property[dict[str, str]][source]
domain_elections: onegov.core.orm.mixins.dict_property[onegov.election_day.types.DomainOfInfluence][source]
elections: relationship[list[Election]][source]
elections_observer(elections: Collection[Election]) None[source]
property progress: tuple[int, int][source]

Returns a tuple with the current progress.

If the elections define a domain_supersegment (i.e. superregions), this is the number of fully counted supersegments vs. the total number of supersegments.

If no domain_supersegment is defined, this is the number of counted elections vs. the total number of elections.

property has_results: bool[source]

Returns True, if the election compound has any results.

property elected_candidates: list[tuple[str, str]][source]

Returns the first and last names of the elected candidates.

upper_apportionment_pdf[source]
lower_apportionment_pdf[source]
property relationships_for_historical_party_results: AppenderQuery[ElectionCompoundRelationship][source]
clear_results(clear_all: bool = False) None[source]

Clears all related results.