election_day.models.vote.ballot
Classes
A ballot contains a single question asked for a vote. |
Module Contents
- class election_day.models.vote.ballot.Ballot[source]
Bases:
onegov.core.orm.Base
,onegov.core.orm.mixins.TimestampMixin
,onegov.election_day.models.mixins.TitleTranslationsMixin
,onegov.election_day.models.vote.mixins.DerivedAttributesMixin
,onegov.election_day.models.vote.mixins.DerivedBallotsCountMixin
A ballot contains a single question asked for a vote.
Usually each vote has exactly one ballot, but it’s possible for votes to have multiple ballots.
In the latter case there are usually two options that are mutually exclusive and a third option that acts as a tie breaker between the frist two options.
The type of the ballot indicates this. Standard ballots only contain one question, variant ballots contain multiple questions.
- results: relationship[list[BallotResult]][source]
- property results_by_district: Query[ResultsByDistrictRow][source]
Returns the results aggregated by the distict.
- property progress: tuple[int, int][source]
Returns a tuple with the first value being the number of counted ballot results and the second value being the number of total ballot results.
- aggregate_results(attribute: str) int [source]
Gets the sum of the given attribute from the results.