election_day.models.vote.vote
Classes
A vote describes the issue being voted on. For example, |
Module Contents
- class election_day.models.vote.vote.Vote[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.StatusMixin
,onegov.election_day.models.mixins.TitleTranslationsMixin
,onegov.election_day.models.mixins.IdFromTitlesMixin
,onegov.election_day.models.vote.mixins.DerivedBallotsCountMixin
,onegov.election_day.models.mixins.ExplanationsPdfMixin
A vote describes the issue being voted on. For example, “Vote for Net Neutrality” or “Vote for Basic Income”.
- title_observer(title_translations: Mapping[str, str], short_title_translations: Mapping[str, str]) None [source]
- ballot(ballot_type: onegov.election_day.types.BallotType) onegov.election_day.models.vote.ballot.Ballot [source]
Returns the given ballot if it exists, creates it if not.
- property progress: tuple[int, int][source]
Returns a tuple with the first value being the number of counted entities and the second value being the number of total entities.
For complex votes, it is assumed that every ballot has the same progress.
- property counted_entities: list[str][source]
Returns the names of the already counted entities.
Might contain an empty string in case of expats.
For complex votes, it is assumed that every ballot has the same progress.
- aggregate_results(attribute: str) int [source]
Gets the sum of the given attribute from the results.
- classmethod aggregate_results_expression(attribute: str) ColumnElement[int] [source]
Gets the sum of the given attribute from the results, as SQL expression.
- last_modified() datetime.datetime | None [source]
Returns last change of the vote, its ballots and any of its results.
- data_sources: relationship[list[DataSourceItem]][source]
- notifications: relationship[AppenderQuery[Notification]][source]