org.forms.widgets

Module Contents

Classes

UploadOrLinkExistingFileWidget

An upload widget for the onegov.form.fields.UploadField class,

UploadOrSelectExistingFileWidget

An upload widget for the onegov.form.fields.UploadField class,

UploadOrSelectExistingMultipleFilesWidget

A widget for the onegov.form.fields.UploadMultipleField class,

class org.forms.widgets.UploadOrLinkExistingFileWidget(multiple=False)[source]

Bases: onegov.form.widgets.UploadWidget

An upload widget for the onegov.form.fields.UploadField class, which supports keeping, removing and replacing already uploaded files.

This is necessary as file inputs are read-only on the client and it’s therefore rather easy for users to lose their input otherwise (e.g. a form with a file is rejected because of some mistake - the file disappears once the response is rendered on the client).

file_details_template[source]
file_details_icon_template[source]
template_data(field: org.forms.fields.UploadOrSelectExistingFileField, force_simple: bool, resend_upload: bool, wrapper_css_class: str, input_html: markupsafe.Markup, **kwargs: Any) tuple[bool, dict[str, Any]][source]
class org.forms.widgets.UploadOrSelectExistingFileWidget(multiple=False)[source]

Bases: UploadOrLinkExistingFileWidget

An upload widget for the onegov.form.fields.UploadField class, which supports keeping, removing and replacing already uploaded files.

This is necessary as file inputs are read-only on the client and it’s therefore rather easy for users to lose their input otherwise (e.g. a form with a file is rejected because of some mistake - the file disappears once the response is rendered on the client).

simple_template[source]
template[source]
template_data(field: org.forms.fields.UploadOrSelectExistingFileField, force_simple: bool, resend_upload: bool, wrapper_css_class: str, input_html: markupsafe.Markup, **kwargs: Any) tuple[bool, dict[str, Any]][source]
class org.forms.widgets.UploadOrSelectExistingMultipleFilesWidget[source]

Bases: onegov.form.widgets.UploadMultipleWidget

A widget for the onegov.form.fields.UploadMultipleField class, which supports keeping, removing and replacing already uploaded files.

This is necessary as file inputs are read-only on the client and it’s therefore rather easy for users to lose their input otherwise (e.g. a form with a file is rejected because of some mistake - the file disappears once the response is rendered on the client).

We deviate slightly from the norm by rendering the errors ourselves since we’re essentially a list of fields and not a single field most of the time.

additional_label[source]
render_input(field: org.forms.fields.UploadOrSelectExistingMultipleFilesField, **kwargs: Any) markupsafe.Markup[source]