election_day.models.election_compound.part

Attributes

T

Classes

inherited_attribute

Abstract base class for generic types.

ElectionCompoundPart

A part of an election compound.

Module Contents

election_day.models.election_compound.part.T[source]
class election_day.models.election_compound.part.inherited_attribute[source]

Bases: Generic[T]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
__set_name__(owner: type[Any], name: str) None[source]
__get__(instance: Any, owner: type[Any]) T[source]
class election_day.models.election_compound.part.ElectionCompoundPart(election_compound: onegov.election_day.models.ElectionCompound, domain: str, segment: str)[source]

Bases: onegov.election_day.models.election_compound.mixins.DerivedAttributesMixin, onegov.election_day.models.party_result.mixins.PartyResultsCheckMixin, onegov.election_day.models.party_result.mixins.HistoricalPartyResultsMixin

A part of an election compound.

Covers a part of an election compound between the domain of the compound and the domain of the elections.

There is no database object behind a part of an election compound, all the results are either taken from the compound (parties) or elections (candidates)-

election_compound[source]
election_compound_id[source]
domain[source]
segment[source]
id[source]
__eq__(other: object) bool[source]
date: inherited_attribute[datetime.date][source]
completes_manually: inherited_attribute[bool][source]
manually_completed: inherited_attribute[bool][source]
pukelsheim[source]
last_result_change[source]
last_change[source]
last_modified[source]
domain_elections[source]
colors[source]
voters_counts[source]
exact_voters_counts[source]
horizontal_party_strengths[source]
show_party_strengths[source]
use_historical_party_results[source]
session_manager[source]
property title: str[source]
property short_title: str | None[source]
property title_translations: dict[str, str][source]
property short_title_translations: dict[str, str][source]
property elections: list[onegov.election_day.models.Election][source]
property progress: tuple[int, int][source]
property party_results: list[PartyResult][source]
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: Query[ElectionCompoundRelationship][source]