election_day.models.archived_result

Attributes

ResultType

meta_local_property

Classes

ArchivedResult

Stores the result of an election or vote.

Module Contents

election_day.models.archived_result.ResultType: typing_extensions.TypeAlias[source]
election_day.models.archived_result.meta_local_property[source]
class election_day.models.archived_result.ArchivedResult[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.ContentMixin, onegov.core.orm.mixins.TimestampMixin, onegov.election_day.models.mixins.DomainOfInfluenceMixin, onegov.election_day.models.mixins.TitleTranslationsMixin

Stores the result of an election or vote.

__tablename__ = 'archived_results'[source]
id: Column[uuid.UUID][source]
date: Column[datetime.date][source]
last_modified: Column[datetime.datetime | None][source]
last_result_change: Column[datetime.datetime | None][source]
type: Column[ResultType][source]
schema: Column[str][source]
name: Column[str][source]
total_entities: Column[int | None][source]
counted_entities: Column[int | None][source]
property progress: tuple[int, int][source]
has_results: Column[bool | None][source]
url: Column[str][source]
title_translations: Column[Mapping[str, str]][source]
title[source]
title_prefix(request: onegov.election_day.request.ElectionDayRequest) str[source]
shortcode: Column[str | None][source]
external_id: onegov.core.orm.mixins.dict_property[str | None][source]
elected_candidates: onegov.core.orm.mixins.dict_property[list[tuple[str, str]]][source]
elections: onegov.core.orm.mixins.dict_property[list[str]][source]
answer: onegov.core.orm.mixins.dict_property[str][source]
nays_percentage: onegov.core.orm.mixins.dict_property[float][source]
yeas_percentage: onegov.core.orm.mixins.dict_property[float][source]
counted: onegov.core.orm.mixins.dict_property[bool][source]
completed: onegov.core.orm.mixins.dict_property[bool][source]
turnout: onegov.core.orm.mixins.dict_property[float | None][source]
direct: onegov.core.orm.mixins.dict_property[bool][source]
local: onegov.core.orm.mixins.dict_property[dict[str, Any] | None][source]
local_answer: onegov.core.orm.mixins.dict_property[str][source]
local_nays_percentage: onegov.core.orm.mixins.dict_property[float][source]
local_yeas_percentage: onegov.core.orm.mixins.dict_property[float][source]
property type_class: _type[Election | ElectionCompound | Vote][source]
is_fetched(request: onegov.election_day.request.ElectionDayRequest) bool[source]

Returns True, if this results has been fetched from another instance.

is_fetched_by_municipality(request: onegov.election_day.request.ElectionDayRequest) bool[source]

Returns True, if this results has been fetched from another instance by a communal instance.

adjusted_url(request: onegov.election_day.request.ElectionDayRequest) str[source]

Returns the url adjusted to the current host. Needed if the instance is accessible under different hosts at the same time.

display_answer(request: onegov.election_day.request.ElectionDayRequest) str[source]

Returns the answer (depending on the current instance).

display_nays_percentage(request: onegov.election_day.request.ElectionDayRequest) float[source]

Returns the nays rate (depending on the current instance).

display_yeas_percentage(request: onegov.election_day.request.ElectionDayRequest) float[source]

Returns the yeas rate (depending on the current instance).

copy_from(source: typing_extensions.Self) None[source]