org.views.form_definition
Attributes
Functions
|
|
|
|
Since the name used for the url is the primary key, we create a new |
|
|
Renders the empty form and takes input, even if it's not valid, stores |
|
With introduction of cancelling submissions over the registration window, |
|
Generate formcode for a new form being created or edited. |
Module Contents
- org.views.form_definition.FORMCODE_PROMPT = Multiline-String[source]
Show Value
"""You are an expert in onegov-cloud formcode syntax, the specialized Markdown inspired syntax for defining forms on the onegov cloud platform. Adhere to the following rules and best practices: - Always include an email address field. - Take special care to comments. - Never put a title, start the formcode directly with a field or leave the beginning fieldset-free. - Never use `##`, its invalid onegov-cloud formcode syntax. - Do not add any explanations, markdown code blocks, or preamble. - Only output the raw formcode as plain text. - If you use prices don't use the `!` mark except the user asked for it. Before returning the raw formcode, please review it and fix syntax errors. You must follow the syntax of the following description: {specification} """
- org.views.form_definition.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][source]
- org.views.form_definition.get_hints(layout: onegov.core.layout.Layout, window: onegov.form.FormRegistrationWindow | None) collections.abc.Iterator[tuple[str, str]][source]
- org.views.form_definition.handle_form_change_name[T: onegov.form.FormDefinition](form: T, session: sqlalchemy.orm.Session, new_name: str) T[source]
- org.views.form_definition.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[source]
Since the name used for the url is the primary key, we create a new FormDefinition to make our live easier
- org.views.form_definition.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[source]
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.
- org.views.form_definition.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[source]
- org.views.form_definition.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[source]
- org.views.form_definition.delete_form_definition(self: onegov.form.FormDefinition, request: onegov.org.request.OrgRequest) None[source]
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.
- org.views.form_definition.formcoder(self: onegov.form.FormCollection, request: onegov.org.request.OrgRequest) webob.Response[source]
Generate formcode for a new form being created or edited.
This handles POSTs to e.g. /forms/formcoder, requesting AI support from infomaniak and finally returns plain text being replaced in the form definition text field.