election_day.utils.summaries

Attributes

ElectionCompoundOrPart

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

Module Contents

election_day.utils.summaries.ElectionCompoundOrPart: TypeAlias = ElectionCompound | ElectionCompoundPart[source]
election_day.utils.summaries.get_election_summary(election: onegov.election_day.models.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.election_day.models.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.election_day.models.Election | onegov.election_day.models.ElectionCompound | onegov.election_day.models.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.