ballot.models.election_compound.election_compound

Module Contents

Classes

ElectionCompound

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

Attributes

rel

ballot.models.election_compound.election_compound.rel[source]
class ballot.models.election_compound.election_compound.ElectionCompound[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.ContentMixin, onegov.ballot.models.mixins.LastModifiedMixin, onegov.ballot.models.mixins.DomainOfInfluenceMixin, onegov.ballot.models.mixins.TitleTranslationsMixin, onegov.ballot.models.party_result.mixins.PartyResultsOptionsMixin, onegov.ballot.models.party_result.mixins.PartyResultsCheckMixin, onegov.ballot.models.party_result.mixins.HistoricalPartyResultsMixin, onegov.ballot.models.mixins.ExplanationsPdfMixin, onegov.ballot.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).

property polymorphic_base: type[ElectionCompound][source]
property session: sqlalchemy.orm.Session[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.

property relationships_for_historical_party_results: AppenderQuery[ElectionCompoundRelationship][source]
__tablename__ = 'election_compounds'[source]
id: Column[str][source]
external_id: Column[str | None][source]
title_translations: Column[Mapping[str, str]][source]
title[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.ballot.types.DomainOfInfluence][source]
elections: relationship[list[Election]][source]
upper_apportionment_pdf[source]
lower_apportionment_pdf[source]
title_observer(translations: Mapping[str, str]) None[source]
elections_observer(elections: Collection[Election]) None[source]
clear_results(clear_all: bool = False) None[source]

Clears all related results.