election_day.models.vote.mixins

Classes

DerivedAttributesMixin

A simple mixin to add commonly used functions to ballots and their

DerivedBallotsCountMixin

A simple mixin to add commonly used functions to votes, ballots and

Module Contents

class election_day.models.vote.mixins.DerivedAttributesMixin[source]

A simple mixin to add commonly used functions to ballots and their results.

yeas_percentage: sqlalchemy.Column[float][source]
nays_percentage() float[source]

The percentage of nays (discounts empty/invalid ballots).

accepted() bool[source]
class election_day.models.vote.mixins.DerivedBallotsCountMixin[source]

A simple mixin to add commonly used functions to votes, ballots and their results.

cast_ballots: sqlalchemy.Column[int][source]
turnout() float[source]