election_day.models.data_source

Attributes

UploadType

UPLOAD_TYPE_LABELS

Classes

DataSource

Stores the data source of an upload.

DataSourceItem

Stores the configuration of an auto upload.

Module Contents

election_day.models.data_source.UploadType: TypeAlias = Literal['vote', 'proporz', 'majorz'][source]
election_day.models.data_source.UPLOAD_TYPE_LABELS[source]
class election_day.models.data_source.DataSource[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.TimestampMixin

Stores the data source of an upload.

__tablename__ = 'upload_data_source'[source]
id: Column[uuid.UUID][source]
name: Column[str][source]
token: Column[uuid.UUID][source]
type: Column[UploadType][source]
items: relationship[AppenderQuery[DataSourceItem]][source]
property label: str[source]
query_candidates() Query[Election | Vote][source]

Returns a list of available votes or elections matching the type of the source.

class election_day.models.data_source.DataSourceItem[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.TimestampMixin

Stores the configuration of an auto upload.

__tablename__ = 'upload_data_source_item'[source]
id: Column[uuid.UUID][source]
source_id: Column[uuid.UUID][source]
district: Column[str | None][source]
number: Column[str | None][source]
election_id: Column[str | None][source]
election: relationship[Election | None][source]
vote_id: Column[str | None][source]
vote: relationship[Vote | None][source]
source: relationship[DataSource][source]
property item: onegov.election_day.models.election.Election | onegov.election_day.models.vote.Vote | None[source]

Returns the vote or election.

property name: str[source]