election_day.utils.election.lists

Classes

ListResultRow

Functions

get_list_results(→ Query[ListResultRow])

Returns the aggregated list results as list.

get_lists_data(→ onegov.core.types.JSONObject_ro)

" View the lists as JSON. Used to for the lists bar chart.

get_lists_panachage_data(→ onegov.core.types.JSONObject_ro)

" Get the panachage data as JSON. Used to for the panachage sankey

Module Contents

class election_day.utils.election.lists.ListResultRow[source]

Bases: NamedTuple

votes: int[source]
name: str[source]
number_of_mandates: int[source]
election_day.utils.election.lists.get_list_results(election: onegov.election_day.models.Election, limit: int | None = None, names: Collection[str] | None = None, sort_by_names: bool = False, entities: Collection[str] | None = None) Query[ListResultRow][source]

Returns the aggregated list results as list.

election_day.utils.election.lists.get_lists_data(election: onegov.election_day.models.Election, limit: int | None = None, names: Collection[str] | None = None, mandates_only: bool = False, sort_by_names: bool = False, entities: Collection[str] | None = None) onegov.core.types.JSONObject_ro[source]

“ View the lists as JSON. Used to for the lists bar chart.

election_day.utils.election.lists.get_lists_panachage_data(election: onegov.election_day.models.Election, request: ElectionDayRequest | None) onegov.core.types.JSONObject_ro[source]

“ Get the panachage data as JSON. Used to for the panachage sankey chart.