ballot.models.vote.mixins

Module Contents

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

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

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

yeas_percentage() float[source]

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

yeas_percentage() ColumnElement[float][source]
nays_percentage() float[source]

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

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

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

cast_ballots() int[source]
turnout() float[source]
turnout() ColumnElement[float][source]