ballot.models.election_compound.part

Module Contents

Classes

inherited_attribute

Abstract base class for generic types.

ElectionCompoundPart

A part of an election compound.

Attributes

T

ballot.models.election_compound.part.T[source]
class ballot.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 ballot.models.election_compound.part.ElectionCompoundPart(election_compound: onegov.ballot.models.election_compound.election_compound.ElectionCompound, domain: str, segment: str)[source]

Bases: onegov.ballot.models.election_compound.mixins.DerivedAttributesMixin, onegov.ballot.models.party_result.mixins.PartyResultsCheckMixin, onegov.ballot.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)-

property title: str[source]
property title_translations: dict[str, str][source]
property elections: list[onegov.ballot.models.election.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 relationships_for_historical_party_results: Query[ElectionCompoundRelationship][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]
__eq__(other: object) bool[source]

Return self==value.