election_day.utils.summaries

Module Contents

Functions

get_election_summary(→ onegov.core.types.JSONObject_ro)

Returns some basic informations about the given election as a JSON

get_election_compound_summary(...)

get_vote_summary(→ onegov.core.types.JSONObject_ro)

Returns some basic informations about the given vote as a JSON

get_summary(→ onegov.core.types.JSONObject_ro)

Returns some basic informations about the given election/vote as a JSON

get_summaries(→ list[onegov.core.types.JSONObject_ro])

Converts the given list of election/votes to a JSON seriazable

Attributes

ElectionCompoundOrPart

election_day.utils.summaries.ElectionCompoundOrPart: typing_extensions.TypeAlias[source]
election_day.utils.summaries.get_election_summary(election: onegov.ballot.Election | onegov.election_day.models.ArchivedResult, request: ElectionDayRequest | None, url: str | None = None) onegov.core.types.JSONObject_ro[source]

Returns some basic informations about the given election as a JSON seriazable dict.

election_day.utils.summaries.get_election_compound_summary(election_compound: ElectionCompoundOrPart | ArchivedResult, request: ElectionDayRequest | None, url: str | None = None, type_: str = 'election_compound') onegov.core.types.JSONObject_ro[source]
election_day.utils.summaries.get_vote_summary(vote: onegov.ballot.Vote | onegov.election_day.models.ArchivedResult, request: ElectionDayRequest | None, url: str | None = None) onegov.core.types.JSONObject_ro[source]

Returns some basic informations about the given vote as a JSON seriazable dict.

election_day.utils.summaries.get_summary(item: onegov.ballot.Election | onegov.ballot.ElectionCompound | onegov.ballot.Vote | onegov.election_day.models.ArchivedResult, request: onegov.election_day.request.ElectionDayRequest) onegov.core.types.JSONObject_ro[source]

Returns some basic informations about the given election/vote as a JSON seriazable dict.

election_day.utils.summaries.get_summaries(items: Iterable[Election | ElectionCompound | Vote | ArchivedResult], request: onegov.election_day.request.ElectionDayRequest) list[onegov.core.types.JSONObject_ro][source]

Converts the given list of election/votes to a JSON seriazable list of summaries.