Defines a registration window during which a form definition

Module Contents

class form.models.registration_window.FormRegistrationWindow[source]

Bases: onegov.core.orm.Base, 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.

__tablename__ = 'registration_windows'[source]
id: Column[uuid.UUID][source]
name: Column[str][source]
enabled: Column[bool][source]
start: Column[date][source]
end: Column[date][source]
timezone: Column[str][source]
limit: Column[int | None][source]
overflow: Column[bool][source]
submissions: relationship[list[FormSubmission]][source]
property localized_start: datetime.datetime[source]
property localized_end: datetime.datetime[source]
accepts_submissions(required_spots: int = 1) bool[source]
disassociate() None[source]

Disassociates all records linked to this window.

property available_spots: int[source]
property claimed_spots: int[source]

Returns the number of actually claimed spots.

property requested_spots: int[source]

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.

property next_submission: onegov.form.models.submission.FormSubmission | None[source]

Returns the submission next in line. In other words, the next submission in order of first come, first serve.

property in_the_future: bool[source]
property in_the_past: bool[source]
property in_the_present: bool[source]