election_day.models.data_source =============================== .. py:module:: election_day.models.data_source Attributes ---------- .. autoapisummary:: election_day.models.data_source.UploadType election_day.models.data_source.UPLOAD_TYPE_LABELS Classes ------- .. autoapisummary:: election_day.models.data_source.DataSource election_day.models.data_source.DataSourceItem Module Contents --------------- .. py:type:: UploadType :canonical: Literal['vote', 'proporz', 'majorz'] .. py:data:: UPLOAD_TYPE_LABELS .. py:class:: DataSource Bases: :py:obj:`onegov.core.orm.Base`, :py:obj:`onegov.core.orm.mixins.TimestampMixin` Stores the data source of an upload. .. py:attribute:: __tablename__ :value: 'upload_data_source' .. py:attribute:: id :type: sqlalchemy.Column[uuid.UUID] .. py:attribute:: name :type: sqlalchemy.Column[str] .. py:attribute:: token :type: sqlalchemy.Column[uuid.UUID] .. py:attribute:: type :type: sqlalchemy.Column[UploadType] .. py:attribute:: items :type: sqlalchemy.orm.relationship[onegov.core.types.AppenderQuery[DataSourceItem]] .. py:property:: label :type: str .. py:method:: query_candidates() -> sqlalchemy.orm.Query[onegov.election_day.models.election.Election | onegov.election_day.models.vote.Vote] Returns a list of available votes or elections matching the type of the source. .. py:class:: DataSourceItem Bases: :py:obj:`onegov.core.orm.Base`, :py:obj:`onegov.core.orm.mixins.TimestampMixin` Stores the configuration of an auto upload. .. py:attribute:: __tablename__ :value: 'upload_data_source_item' .. py:attribute:: id :type: sqlalchemy.Column[uuid.UUID] .. py:attribute:: source_id :type: sqlalchemy.Column[uuid.UUID] .. py:attribute:: district :type: sqlalchemy.Column[str | None] .. py:attribute:: number :type: sqlalchemy.Column[str | None] .. py:attribute:: election_id :type: sqlalchemy.Column[str | None] .. py:attribute:: election :type: sqlalchemy.orm.relationship[onegov.election_day.models.election.Election | None] .. py:attribute:: vote_id :type: sqlalchemy.Column[str | None] .. py:attribute:: vote :type: sqlalchemy.orm.relationship[onegov.election_day.models.vote.Vote | None] .. py:attribute:: source :type: sqlalchemy.orm.relationship[DataSource] .. py:property:: item :type: onegov.election_day.models.election.Election | onegov.election_day.models.vote.Vote | None Returns the vote or election. .. py:property:: name :type: str