org.forms.survey_submission

Classes

SurveySubmissionWindowForm

Form to edit submission windows.

Module Contents

class org.forms.survey_submission.SurveySubmissionWindowForm(formdata: MultiDict[str, Any] | None = None, obj: object | None = None, prefix: str = '', data: dict[str, Any] | None = None, meta: dict[str, Any] | None = None, *, extra_filters: Mapping[str, Sequence[Any]] | None = None, **kwargs: Any)[source]

Bases: onegov.form.Form

Form to edit submission windows.

model: onegov.form.SurveyDefinition | onegov.form.SurveySubmissionWindow[source]
title[source]
start[source]
end[source]
process_obj(obj: onegov.form.SurveySubmissionWindow) None[source]

Called by process() if an object was passed.

Do not use this function directly. To process an object, you should call form.process(obj=obj) instead.

populate_obj(obj: onegov.form.SurveySubmissionWindow, *args: Any, **kwargs: Any) None[source]

A reimplementation of wtforms populate_obj function with the addage of optional include/exclude filters.

If neither exclude nor include is passed, the function works like it does in wtforms. Otherwise fields are considered which are included but not excluded.

ensure_start_before_end() bool | None[source]

Validate start and end for proper error message. def ensure_start_end(self) would also be run in side the validate function, but the error is not clear.

ensure_unique_title() bool | None[source]

Ensure that the title is unique within the survey.

ensure_no_overlapping_windows() bool | None[source]

Ensure that this registration window does not overlap with other already defined registration windows unless they have a title.