election_day.screen_widgets.vote

Classes

VoteCounterProposalTitleWidget

Abstract base class for generic types.

VoteTieBreakerTitleWidget

Abstract base class for generic types.

VoteProposalResultBarWidget

Abstract base class for generic types.

VoteCounterProposalResultBarWidget

Abstract base class for generic types.

VoteTieBreakerResultBarWidget

Abstract base class for generic types.

VoteProposalEntitiesTableWidget

Abstract base class for generic types.

VoteCounterProposalEntitiesTableWidget

Abstract base class for generic types.

VoteTieBreakerEntitiesTableWidget

Abstract base class for generic types.

VoteProposalEntitiesMap

Abstract base class for generic types.

VoteCounterProposalEntitiesMap

Abstract base class for generic types.

VoteTieBreakerEntitiesMap

Abstract base class for generic types.

VoteProposalDistrictsMap

Abstract base class for generic types.

VoteCounterProposalDistrictsMap

Abstract base class for generic types.

VoteTieBreakerDistrictsMap

Abstract base class for generic types.

VoteProposalTurnoutWidget

Abstract base class for generic types.

VoteCounterProposalTurnoutWidget

Abstract base class for generic types.

VoteTieBreakerTurnoutWidget

Abstract base class for generic types.

Module Contents

class election_day.screen_widgets.vote.VoteCounterProposalTitleWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.Vote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-counter-proposal-title'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-counter-proposal-title">
            <span
                tal:content="model.counter_proposal.title"
                class="{@class}"
                />
        </xsl:template>
    """
usage = '<vote-counter-proposal-title class=""/>'[source]
class election_day.screen_widgets.vote.VoteTieBreakerTitleWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-tie-breaker-title'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-tie-breaker-title">
            <span
                tal:content="model.tie_breaker.title"
                class="{@class}"
                />
        </xsl:template>
    """
usage = '<vote-tie-breaker-title class=""/>'[source]
class election_day.screen_widgets.vote.VoteProposalResultBarWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.Vote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-proposal-result-bar'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-proposal-result-bar">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-result-bar']"
                    tal:define="ballot proposal"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-proposal-result-bar class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteCounterProposalResultBarWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-counter-proposal-result-bar'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-counter-proposal-result-bar">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-result-bar']"
                    tal:define="ballot counter_proposal"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-counter-proposal-result-bar class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteTieBreakerResultBarWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-tie-breaker-result-bar'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-tie-breaker-result-bar">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-result-bar']"
                    tal:define="ballot tie_breaker"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-tie-breaker-result-bar class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteProposalEntitiesTableWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.Vote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-proposal-entities-table'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-proposal-entities-table">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-entities-table']"
                    tal:define="ballot proposal;
                                results proposal_results"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-proposal-entities-table class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteCounterProposalEntitiesTableWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-counter-proposal-entities-table'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-counter-proposal-entities-table">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-entities-table']"
                    tal:define="ballot counter_proposal;
                                results counter_proposal_results"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-counter-proposal-entities-table class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteTieBreakerEntitiesTableWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-tie-breaker-entities-table'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-tie-breaker-entities-table">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-entities-table']"
                    tal:define="ballot tie_breaker;
                                results tie_breaker_results"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-tie-breaker-entities-table class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteProposalEntitiesMap(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.Vote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-proposal-entities-map'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-proposal-entities-map">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-entities-map']"
                    tal:define="ballot proposal"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-proposal-entities-map class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteCounterProposalEntitiesMap(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-counter-proposal-entities-map'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-counter-proposal-entities-map">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-entities-map']"
                    tal:define="ballot counter_proposal"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-counter-proposal-entities-map class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteTieBreakerEntitiesMap(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-tie-breaker-entities-map'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-tie-breaker-entities-map">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-entities-map']"
                    tal:define="ballot tie_breaker"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-tie-breaker-entities-map class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteProposalDistrictsMap(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.Vote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-proposal-districts-map'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-proposal-districts-map">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-districts-map']"
                    tal:define="ballot proposal"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-proposal-districts-map class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteCounterProposalDistrictsMap(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-counter-proposal-districts-map'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-counter-proposal-districts-map">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-districts-map']"
                    tal:define="ballot counter_proposal"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-counter-proposal-districts-map class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteTieBreakerDistrictsMap(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-tie-breaker-districts-map'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-tie-breaker-districts-map">
            <div class="{@class}">
                <tal:block
                    metal:use-macro="layout.macros['ballot-districts-map']"
                    tal:define="ballot tie_breaker"
                    />
            </div>
        </xsl:template>
    """
usage = '<vote-tie-breaker-districts-map class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteProposalTurnoutWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.Vote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-proposal-turnout'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-proposal-turnout">
            <span class="{@class}">
                ${'{0:.2f}'.format(proposal.turnout)} %
            </span>
        </xsl:template>
    """
usage = '<vote-proposal-turnout class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteCounterProposalTurnoutWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-counter-proposal-turnout'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-counter-proposal-turnout">
            <span class="{@class}">
                ${'{0:.2f}'.format(counter_proposal.turnout)} %
            </span>
        </xsl:template>
    """
usage = '<vote-counter-proposal-turnout class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]
class election_day.screen_widgets.vote.VoteTieBreakerTurnoutWidget(model: _E | None = None)[source]

Bases: onegov.election_day.screen_widgets.generic.ModelBoundWidget[onegov.election_day.models.ComplexVote]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
tag = 'vote-tie-breaker-turnout'[source]
template = Multiline-String[source]
Show Value
"""
        <xsl:template match="vote-tie-breaker-turnout">
            <span class="{@class}">
                ${'{0:.2f}'.format(tie_breaker.turnout)} %
            </span>
        </xsl:template>
    """
usage = '<vote-tie-breaker-turnout class=""/>'[source]
get_variables(layout: onegov.election_day.layouts.DefaultLayout) dict[str, Any][source]