form.models.registration_window =============================== .. py:module:: form.models.registration_window Attributes ---------- .. autoapisummary:: form.models.registration_window.daterange Classes ------- .. autoapisummary:: form.models.registration_window.FormRegistrationWindow Module Contents --------------- .. py:data:: daterange .. py:class:: FormRegistrationWindow Bases: :py:obj:`onegov.core.orm.Base`, :py:obj:`onegov.core.orm.mixins.TimestampMixin` Defines a registration window during which a form definition may be used to create submissions. Submissions created thusly are attached to the currently active registration window. Registration windows may not overlap. .. py:attribute:: __tablename__ :value: 'registration_windows' .. py:attribute:: id :type: sqlalchemy.Column[uuid.UUID] .. py:attribute:: name :type: sqlalchemy.Column[str] .. py:attribute:: form :type: sqlalchemy.orm.relationship[onegov.form.models.definition.FormDefinition] .. py:attribute:: enabled :type: sqlalchemy.Column[bool] .. py:attribute:: start :type: sqlalchemy.Column[datetime.date] .. py:attribute:: end :type: sqlalchemy.Column[datetime.date] .. py:attribute:: timezone :type: sqlalchemy.Column[str] .. py:attribute:: limit :type: sqlalchemy.Column[int | None] .. py:attribute:: overflow :type: sqlalchemy.Column[bool] .. py:attribute:: submissions :type: sqlalchemy.orm.relationship[list[onegov.form.models.submission.FormSubmission]] .. py:attribute:: __table_args__ .. py:property:: localized_start :type: datetime.datetime .. py:property:: localized_end :type: datetime.datetime .. py:method:: disassociate() -> None Disassociates all records linked to this window. .. py:property:: in_the_future :type: bool .. py:property:: in_the_past :type: bool .. py:property:: in_the_present :type: bool .. py:method:: accepts_submissions(required_spots: int = 1) -> bool .. py:property:: next_submission :type: onegov.form.models.submission.FormSubmission | None Returns the submission next in line. In other words, the next submission in order of first come, first serve. .. py:property:: available_spots :type: int .. py:property:: claimed_spots :type: int Returns the number of actually claimed spots. .. py:property:: requested_spots :type: int Returns the number of requested spots. When the claim has not been made yet, `spots` are counted as requested. When the claim has been partially made, the difference is counted as requested. If the claim has been fully made, the result is 0. If the claim has been relinquished, the result is 0.