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.ExplanationsPdfMixinA vote describes the issue being voted on. For example, “Vote for Net Neutrality” or “Vote for Basic Income”.
- title_observer(title_translations: collections.abc.Mapping[str, str], short_title_translations: collections.abc.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]
A tuple of (counted entities, total entities).
For complex votes, it is assumed that every ballot has the same progress.
- property counted_entities: list[str][source]
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) sqlalchemy.sql.ColumnElement[int][source]
Gets the sum of the given attribute from the results, as SQL expression.
- last_ballot_change() datetime.datetime | None[source]
Returns last change of the vote, its ballots and any of its results.
- classmethod _last_ballot_change_expression() sqlalchemy.sql.ColumnElement[datetime.datetime | None][source]
- last_modified() datetime.datetime | None[source]
Returns last change of the vote, its ballots and any of its results.
- classmethod _last_modified_expression() sqlalchemy.sql.ColumnElement[datetime.datetime | None][source]