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: sqlalchemy.Column[str][source]
title: sqlalchemy.Column[str][source]
definition: sqlalchemy.Column[str][source]
pick_up: onegov.core.orm.mixins.dict_property[str | None][source]
group: sqlalchemy.Column[str | None][source]
order: sqlalchemy.Column[str][source]
checksum: sqlalchemy.Column[str][source]
type: sqlalchemy.Column[str][source]
submissions: sqlalchemy.orm.relationship[list[onegov.form.models.submission.FormSubmission]][source]
registration_windows: sqlalchemy.orm.relationship[list[onegov.form.models.registration_window.FormRegistrationWindow]][source]
current_registration_window: sqlalchemy.orm.relationship[onegov.form.models.registration_window.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: sqlalchemy.Column[onegov.pay.types.PaymentMethod][source]
minimum_price_total: onegov.core.orm.mixins.dict_property[float | None][source]
__mapper_args__[source]
property form_class: type[onegov.form.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: onegov.form.types.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: sqlalchemy.Column[str][source]
title: sqlalchemy.Column[str][source]
definition: sqlalchemy.Column[str][source]
group: sqlalchemy.Column[str | None][source]
order: sqlalchemy.Column[str][source]
checksum: sqlalchemy.Column[str][source]
submissions: sqlalchemy.orm.relationship[list[onegov.form.models.submission.SurveySubmission]][source]
submission_windows: sqlalchemy.orm.relationship[list[onegov.form.models.survey_window.SurveySubmissionWindow]][source]
current_submission_window: sqlalchemy.orm.relationship[onegov.form.models.survey_window.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.UUID | None = None) dict[str, Any][source]

Returns the results of the survey.