election_day.utils.filenames

Functions

filename_prefix(→ str)

pdf_filename(→ str)

Generates a filename from an election or vote:

svg_filename(→ str)

Generates a filename from an election, ballot or vote:

Module Contents

election_day.utils.filenames.filename_prefix(item: object) str[source]
election_day.utils.filenames.pdf_filename(item: onegov.election_day.models.Ballot | onegov.election_day.models.Vote | onegov.election_day.models.Election | onegov.election_day.models.ElectionCompound | onegov.election_day.models.ElectionCompoundPart, locale: str, last_modified: datetime | None = None) str[source]

Generates a filename from an election or vote:

['election' or 'vote']-[hash of id].[timestamp].[locale].pdf
election_day.utils.filenames.svg_filename(item: onegov.election_day.models.Ballot | onegov.election_day.models.Vote | onegov.election_day.models.Election | onegov.election_day.models.ElectionCompound | onegov.election_day.models.ElectionCompoundPart, type_: str | None, locale: str, last_modified: datetime | None = None) str[source]

Generates a filename from an election, ballot or vote:

['election' or 'vote']-[hash of id].[type_].[timestamp].[locale].svg