org.views.form_definition ========================= .. py:module:: org.views.form_definition Attributes ---------- .. autoapisummary:: org.views.form_definition.FormDefinitionT Functions --------- .. autoapisummary:: org.views.form_definition.get_form_class org.views.form_definition.get_hints org.views.form_definition.handle_form_change_name org.views.form_definition.handle_change_form_name org.views.form_definition.handle_defined_form org.views.form_definition.handle_new_definition org.views.form_definition.handle_edit_definition org.views.form_definition.delete_form_definition Module Contents --------------- .. py:data:: FormDefinitionT .. py:function:: get_form_class(model: onegov.org.models.BuiltinFormDefinition | onegov.org.models.CustomFormDefinition | onegov.form.FormCollection, request: onegov.org.request.OrgRequest) -> type[onegov.org.forms.FormDefinitionForm] .. py:function:: get_hints(layout: onegov.core.layout.Layout, window: onegov.form.FormRegistrationWindow | None) -> collections.abc.Iterator[tuple[str, str]] .. py:function:: handle_form_change_name(form: FormDefinitionT, session: sqlalchemy.orm.Session, new_name: str) -> FormDefinitionT .. py:function:: handle_change_form_name(self: onegov.form.FormDefinition, request: onegov.org.request.OrgRequest, form: onegov.org.forms.form_definition.FormDefinitionUrlForm, layout: onegov.org.layout.FormEditorLayout | None = None) -> onegov.core.types.RenderData | webob.Response Since the name used for the url is the primary key, we create a new FormDefinition to make our live easier .. py:function:: handle_defined_form(self: onegov.form.FormDefinition, request: onegov.org.request.OrgRequest, form: onegov.form.Form, layout: onegov.org.layout.FormSubmissionLayout | None = None) -> onegov.core.types.RenderData | webob.Response Renders the empty form and takes input, even if it's not valid, stores it as a pending submission and redirects the user to the view that handles pending submissions. .. py:function:: handle_new_definition(self: onegov.form.FormCollection, request: onegov.org.request.OrgRequest, form: onegov.org.forms.FormDefinitionForm, layout: onegov.org.layout.FormEditorLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: handle_edit_definition(self: onegov.form.FormDefinition, request: onegov.org.request.OrgRequest, form: onegov.org.forms.FormDefinitionForm, layout: onegov.org.layout.FormEditorLayout | None = None) -> onegov.core.types.RenderData | webob.Response .. py:function:: delete_form_definition(self: onegov.form.FormDefinition, request: onegov.org.request.OrgRequest) -> None With introduction of cancelling submissions over the registration window, we encourage the user to use this functionality to cancel all form submissions through the ticket system. This ensures all submissions are cancelled/denied and the tickets are closed.In that case the ticket itself attached to the submission is deletable. If the customer wants to delete the form directly, we allow it now even when there are completed submissions. In each case there is a ticket associated with it we might take a snapshot before deleting it.