election_day.models.vote.ballot
Classes
Built-in immutable sequence. |
|
A ballot contains a single question asked for a vote. |
Module Contents
- class election_day.models.vote.ballot.ResultsByDistrictRow[source]
Bases:
NamedTupleBuilt-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.
If the argument is a tuple, the return value is the same object.
- 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.DerivedBallotsCountMixinA 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: sqlalchemy.orm.Mapped[list[onegov.election_day.models.vote.ballot_result.BallotResult]][source]
- property results_by_district: sqlalchemy.orm.Query[ResultsByDistrictRow][source]
The results aggregated by district.
- property progress: tuple[int, int][source]
A tuple of (counted ballot results, total ballot results).
- aggregate_results(attribute: str) int[source]
Gets the sum of the given attribute from the results.