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: sqlalchemy.Column[str][source]
external_id: sqlalchemy.Column[str | None][source]
title_translations: sqlalchemy.Column[collections.abc.Mapping[str, str]][source]
title[source]
short_title_translations: sqlalchemy.Column[collections.abc.Mapping[str, str] | None][source]
short_title[source]
title_observer(title_translations: collections.abc.Mapping[str, str], short_title_translations: collections.abc.Mapping[str, str]) None[source]
shortcode: sqlalchemy.Column[str | None][source]
date: sqlalchemy.Column[datetime.date][source]
pukelsheim: sqlalchemy.Column[bool][source]
completes_manually: sqlalchemy.Column[bool][source]
manually_completed: sqlalchemy.Column[bool][source]
party_results: sqlalchemy.orm.relationship[list[onegov.election_day.models.PartyResult]][source]
party_panachage_results: rel[list[onegov.election_day.models.PartyPanachageResult]][source]
related_compounds: rel[onegov.core.types.AppenderQuery[onegov.election_day.models.ElectionCompoundRelationship]][source]
referencing_compounds: rel[onegov.core.types.AppenderQuery[onegov.election_day.models.ElectionCompoundRelationship]][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: sqlalchemy.orm.relationship[list[onegov.election_day.models.Election]][source]
elections_observer(elections: collections.abc.Collection[onegov.election_day.models.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.

notifications: sqlalchemy.orm.relationship[onegov.core.types.AppenderQuery[onegov.election_day.models.Notification]][source]
screens: sqlalchemy.orm.relationship[onegov.core.types.AppenderQuery[onegov.election_day.models.Screen]][source]
upper_apportionment_pdf[source]
lower_apportionment_pdf[source]
property relationships_for_historical_party_results: onegov.core.types.AppenderQuery[onegov.election_day.models.ElectionCompoundRelationship][source]
clear_results(clear_all: bool = False) None[source]

Clears all related results.