form.models.definition

Classes

FormDefinition

Defines a form stored in the database.

SurveyDefinition

Defines a survey stored in the database.

Module Contents

class form.models.definition.FormDefinition[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.ContentMixin, onegov.core.orm.mixins.TimestampMixin, onegov.form.extensions.Extendable, onegov.file.MultiAssociatedFiles

Defines a form stored in the database.

__tablename__ = 'forms'[source]
id() str[source]
name: Column[str][source]
title: Column[str][source]
definition: Column[str][source]
pick_up: onegov.core.orm.mixins.dict_property[str | None][source]
group: Column[str | None][source]
order: Column[str][source]
checksum: Column[str][source]
type: Column[str][source]
submissions: relationship[list[FormSubmission]][source]
registration_windows: relationship[list[FormRegistrationWindow]][source]
current_registration_window: relationship[FormRegistrationWindow | None][source]
lead: onegov.core.orm.mixins.dict_property[str | None][source]
text[source]
extensions: onegov.core.orm.mixins.dict_property[list[str]][source]
payment_method: Column[PaymentMethod][source]
minimum_price_total: onegov.core.orm.mixins.dict_property[float | None][source]
__mapper_args__[source]
property form_class: type_t[Form][source]

Parses the form definition and returns a form class.

definition_observer(definition: str) None[source]
title_observer(title: str) None[source]
has_submissions(with_state: SubmissionState | None = None) bool[source]
add_registration_window(start: datetime.date, end: datetime.date, *, enabled: bool = True, timezone: str = 'Europe/Zurich', limit: int | None = None, overflow: bool = True) onegov.form.models.registration_window.FormRegistrationWindow[source]
for_new_name(name: str) Self[source]
class form.models.definition.SurveyDefinition[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.ContentMixin, onegov.core.orm.mixins.TimestampMixin, onegov.form.extensions.Extendable

Defines a survey stored in the database.

__tablename__ = 'surveys'[source]
id() str[source]
name: Column[str][source]
title: Column[str][source]
definition: Column[str][source]
group: Column[str | None][source]
order: Column[str][source]
checksum: Column[str][source]
submissions: relationship[list[SurveySubmission]][source]
submission_windows: relationship[list[SurveySubmissionWindow]][source]
current_submission_window: relationship[SurveySubmissionWindow | None][source]
lead: onegov.core.orm.mixins.dict_property[str | None][source]
text[source]
extensions: onegov.core.orm.mixins.dict_property[list[str]][source]
property form_class: type[onegov.form.Form][source]

Parses the survey definition and returns a form class.

definition_observer(definition: str) None[source]
title_observer(title: str) None[source]
has_submissions() bool[source]
add_submission_window(start: datetime.date, end: datetime.date, *, enabled: bool = True, timezone: str = 'Europe/Zurich') onegov.form.models.survey_window.SurveySubmissionWindow[source]
get_results(request: onegov.core.request.CoreRequest, sw_id: UUID | None = None) dict[str, Any][source]

Returns the results of the survey.