- -
-

PyAMS forms

-
-

Module contents

-
-
-pyams_form.includeme(config)
-

Pyramid include

-

Split in another package to remove cyclic dependencies with TranslationStringFactory

-
- -
- -
-

Submodules

-
-

pyams_form.form module

-
-
-class pyams_form.form.AJAXAddForm(context, request)
-

Bases: pyams_form.form.AddForm

-

AJAX add form

-
-
-get_ajax_output(changes)
-
- -
- -
-
-class pyams_form.form.AJAXEditForm(context, request)
-

Bases: pyams_form.form.EditForm

-

AJAX edit form

-
-
-get_ajax_output(changes)
-
- -
- -
-
-class pyams_form.form.AJAXForm(context, request)
-

Bases: pyams_form.form.BaseForm

-

AJAX form base class

-
-
-ajax_callback
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-ajax_handler
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-form_options
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-form_target
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-get_ajax_errors(ajax_errors=None)
-

Extract form errors in AJAX format

-
- -
-
-get_ajax_handler()
-
- -
-
-get_ajax_output(changes)
-

Extract AJAX POST output

-
- -
-
-get_form_action()
-
- -
-
-get_form_options()
-
- -
- -
-
-class pyams_form.form.AddForm(context, request)
-

Bases: pyams_form.form.AJAXForm, z3c.form.form.AddForm

-

Add form base class

-
-
-buttons = <z3c.form.button.Buttons object>
-
- -
-
-createAndAdd(data)
-
- -
-
-formErrorsMessage = 'There were some errors.'
-
- -
-
-legend = 'Add form'
-
- -
-
-updateActions()
-
- -
- -
-
-class pyams_form.form.AddFormContextPermissionChecker(context, request, view)
-

Bases: pyams_utils.adapter.ContextRequestViewAdapter

-

Add form context permission checker

-
-
-edit_permission
-
- -
- -
-
-class pyams_form.form.BaseForm(context, request)
-

Bases: pyams_form.group.GroupsBasedForm, z3c.form.form.Form

-

Base form class

-
-
-autocomplete
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-callbacks
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-check_mode()
-
- -
-
-css_class
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-display_hints_on_widgets
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-edit_permission
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-errors
-
- -
-
-forms
-
- -
-
-get_form_action()
-
- -
-
-get_skin(request=None)
-
- -
-
-get_widget_callback(widget)
-
- -
-
-handle_upload
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-icon_css_class
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-input_css_class
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-is_dialog
-
- -
-
-label_css_class
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-layer = <InterfaceClass pyams_form.interfaces.form.IFormLayer>
-
- -
-
-layout = None
-
- -
-
-legend
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-render()
-
- -
-
-subforms
-
- -
-
-subforms_legend
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-tabforms
-
- -
-
-title
-
- -
-
-update()
-
- -
-
-update_content(content, data)
-
- -
-
-warn_on_change
-
- -
- -
-
-class pyams_form.form.DialogAddForm(context, request)
-

Bases: pyams_form.form.AddForm

-

Modal dialog add form

-
-
-buttons = <z3c.form.button.Buttons object>
-
- -
-
-dialog_class = 'modal-medium'
-
- -
- -
-
-class pyams_form.form.DialogDisplayForm(context, request)
-

Bases: pyams_form.form.DisplayForm

-

Modal dialog display form

-
-
-buttons = <z3c.form.button.Buttons object>
-
- -
-
-dialog_class = 'modal-medium'
-
- -
- -
-
-class pyams_form.form.DialogEditForm(context, request)
-

Bases: pyams_form.form.EditForm

-

Modal dialog edit form

-
-
-buttons = <z3c.form.button.Buttons object>
-
- -
-
-dialog_class = 'modal-medium'
-
- -
- -
-
-class pyams_form.form.DisplayForm(context, request)
-

Bases: pyams_form.form.BaseForm, z3c.form.form.DisplayForm

-

Display form base class

-
- -
-
-class pyams_form.form.EditForm(context, request)
-

Bases: pyams_form.form.AJAXForm, z3c.form.form.EditForm

-

Edit form base class

-
-
-applyChanges(data)
-
- -
-
-buttons = <z3c.form.button.Buttons object>
-
- -
-
-formErrorsMessage = 'There were some errors.'
-
- -
-
-legend = 'Edit form'
-
- -
-
-noChangesMessage = 'No changes were applied.'
-
- -
-
-successMessage = 'Data successfully updated.'
-
- -
-
-updateActions()
-
- -
- -
-
-class pyams_form.form.FormSelector(ifaces, config)
-

Bases: object

-

Form event selector

-

This selector can be used by subscriber to filter form events

-
-
-phash()
-
- -
-
-text()
-
- -
- -
-
-class pyams_form.form.InnerAddForm(context, request, view=None)
-

Bases: pyams_form.form.AddForm

-

Inner add form

-
-
-buttons = <z3c.form.button.Buttons object>
-
- -
-
-css_class = 'inner'
-
- -
-
-get_form_action()
-
- -
-
-id
-
- -
- -
-
-class pyams_form.form.InnerDisplayForm(context, request, view=None)
-

Bases: pyams_form.form.DisplayForm

-

Inner display form

-
-
-buttons = <z3c.form.button.Buttons object>
-
- -
-
-css_class = 'inner'
-
- -
-
-get_form_action()
-
- -
-
-id
-
- -
- -
-
-class pyams_form.form.InnerEditForm(context, request, view=None)
-

Bases: pyams_form.form.EditForm

-

Inner edit form

-
-
-buttons = <z3c.form.button.Buttons object>
-
- -
-
-css_class = 'inner'
-
- -
-
-get_form_action()
-
- -
-
-id
-
- -
- -
-
-pyams_form.form.handle_form_skin(event)
-
- -
-
-

pyams_form.group module

-
-
-class pyams_form.group.FormWidgetsGroup(form, id, widgets=None, bordered=True, fieldset_class=None, legend=None, help=None, css_class='', switch=False, checkbox_switch=False, checkbox_field=None, checkbox_mode='hide', hide_if_empty=False)
-

Bases: object

-

Form widgets group

-
-
-bordered
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-checkbox_field
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-checkbox_mode
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-checkbox_switch
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-checkbox_widget
-
- -
-
-checker_state
-
- -
-
-css_class
-
- -
-
-fieldset_class
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-form = None
-
- -
-
-help
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-hide_if_empty
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-id
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-legend
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-subforms
-
- -
-
-subforms_legend
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-switch
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-switchable
-
- -
-
-switcher_state
-
- -
-
-visible
-
- -
-
-visible_widgets
-
- -
-
-widgets
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
- -
-
-class pyams_form.group.GroupsBasedForm
-

Bases: object

-

Groups based form

-

Should be used as a base class for forms also implementing IForm

-
-
-add_group(group)
-
- -
-
-groups
-
- -
-
-main_group_class
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-main_group_legend
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
- -
-
-pyams_form.group.NamedWidgetsGroup(form, id, widgets, names=(), bordered=True, fieldset_class=None, legend=None, help=None, css_class='', switch=False, checkbox_switch=False, checkbox_field=None, checkbox_mode='hide', hide_if_empty=False)
-

Create a widgets group based on widgets names

-
- -
-
-

pyams_form.help module

-
-
-class pyams_form.help.FormHelp(context, request, view)
-

Bases: pyams_utils.adapter.ContextRequestViewAdapter

-

Form help

-
-
-header
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-message
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-message_format
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-mode
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-outer_margin
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-permission
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
-
-status
-

Computed attributes based on schema fields

-

Field properties provide default values, data validation and error messages -based on data found in field meta-data.

-

Note that FieldProperties cannot be used with slots. They can only -be used for attributes stored in instance dictionaries.

-
- -
- -
-
-class pyams_form.help.HelpContentProvider
-

Bases: object

-

Form help provider

-
-
-help = None
-
- -
-
-update()
-
- -
- -
-
-class pyams_form.help.HelpRenderer(context, request, view)
-

Bases: pyams_utils.adapter.ContextRequestViewAdapter

-

Help renderer

-
-
-render(**kwargs)
-
- -
- -
-
-

pyams_form.include module

-
-
-pyams_form.include.include_package(config)
-

Pyramid include

-
- -
-
-

pyams_form.schema module

-
-
-class pyams_form.schema.CloseButton(*args, **kwargs)
-

Bases: z3c.form.button.Button

-

Close button

-
- -
-
-class pyams_form.schema.ResetButton(*args, **kwargs)
-

Bases: z3c.form.button.Button

-

Reset button

-
- -
-
-

pyams_form.search module

-
-
-class pyams_form.search.SearchForm(context, request)
-

Bases: pyams_form.form.AddForm

-

Base search form

-
-
-ajax_handler = 'search-results.html'
-
- -
-
-buttons = <z3c.form.button.Buttons object>
-
- -
-
-edit_permission = 'pyams.ViewSystem'
-
- -
-
-fields = <z3c.form.field.Fields object>
-
- -
-
-form_target = '#search-results'
-
- -
-
-get_search_results()
-
- -
-
-legend = 'Search'
-
- -
-
-updateActions()
-
- -
-
-widget_icon_class = 'fa fa-fw fa-search'
-
- -
- -
-
-class pyams_form.search.SearchResultsView(context, request)
-

Bases: pyams_skin.table.BaseTable

-

Search results view

-
-
-search_form_factory
-

alias of SearchForm

-
- -
- -
-
-class pyams_form.search.SearchResultsViewValuesAdapter(context, request, view)
-

Bases: pyams_utils.adapter.ContextRequestViewAdapter

-

Search results view values adapter

-
-
-values
-
- -
- -
-
-class pyams_form.search.SearchView
-

Bases: object

-

Base search view

-
-
-search_form_factory
-

alias of SearchForm

-
- -
-
-update()
-
- -
- -
-
-

pyams_form.security module

-
-
-class pyams_form.security.ProtectedFormObjectMixin
-

Bases: object

-

Form object protected by a permission

-
-
-permission
-
- -
- -
-
-

pyams_form.terms module

-
-
-class pyams_form.terms.BoolTerms(context, request, form, field, widget)
-

Bases: z3c.form.term.BoolTerms

-

Default yes and no terms are used by default for IBool fields.

-
-
-falseLabel = 'no'
-
- -
-
-trueLabel = 'yes'
-
- -
- -
-
-

pyams_form.viewlet module

-
-
-class pyams_form.viewlet.FormHeaderViewletManager(context, request, view)
-

Bases: pyams_form.viewlet.FormViewletManager

-

Form header viewlet manager, display in modal’s form dialog header

-
- -
-
-class pyams_form.viewlet.FormPrefixViewletManager(context, request, view)
-

Bases: pyams_form.viewlet.FormViewletManager

-

Form prefix viewlet manager, displayed before form

-
- -
-
-class pyams_form.viewlet.FormSuffixViewletManager(context, request, view)
-

Bases: pyams_form.viewlet.FormViewletManager

-

Form suffix viewlet manager, displayed after form

-
- -
-
-class pyams_form.viewlet.FormToolbarViewletsManager(context, request, view)
-

Bases: pyams_form.viewlet.FormViewletManager

-

Form toolbar viewlet manager, displayed inside default form header

-
-
-template = <BoundViewTemplate of None>
-
- -
- -
-
-class pyams_form.viewlet.FormViewletManager(context, request, view)
-

Bases: pyams_viewlet.manager.WeightOrderedViewletManager

-

Base form viewlet manager

-
- -
-
-class pyams_form.viewlet.WidgetsPrefixViewletManager(context, request, view)
-

Bases: pyams_form.viewlet.FormViewletManager

-

Form widgets prefix display manager, displayed before widgets

-
- -
-
-class pyams_form.viewlet.WidgetsSuffixViewletManager(context, request, view)
-

Bases: pyams_form.viewlet.FormViewletManager

-

Form widgets suffix viewlet manager, displayed after widgets

-
- -
-
-
- - -