pyams_form package ⊞

PyAMS_form package

This package is an extension to z3c.form.

It allows to integrate z3c forms into Pyramid; it is adding some features like inner subforms (handled with adapters), form groups (which are ued to group form fields together inside a fieldset in a form), modal forms (which are displayed into a modal window), and is providing default templates for all these elements to be displayed correctly when using PyAMS_zmi package or any other Bootstrap-based skin.

pyams_form.includeme(config)[source]

Pyramid include

Split in another package to remove cyclic dependencies with TranslationStringFactory

pyams_form.form

pyams_form.group

pyams_form.help

pyams_form.include

pyams_form.schema

PyAMS_form.schema module

This module provides an interface and a schema field for form buttons.

class pyams_form.schema.ActionButton(*args, **kwargs)[source]

Bases: z3c.form.button.Button

Action button

click_handler

Button click handler: Javascript function called by button click

label_css_class

Label icon CSS class: CSS class associated with label

modal_target

Modal target?: If True, target URL is opened in a modal frame

url

Button target URL: Target URL accessed by button click

class pyams_form.schema.CloseButton(*args, **kwargs)[source]

Bases: z3c.form.button.Button

Close button

interface pyams_form.schema.IActionButton[source]

Extends: z3c.form.interfaces.IButton

Action button interface

An action button is a form button which can be used to redirect the user to a “target” URL, eventually opened in a modal window, or which can call a “click” handler which is the name of a javascript function.

label

Button label

Button label displayed as hint

Implementation:zope.schema.TextLine
Read Only:False
Required:False
Default Value:None
Allowed Type:str
label_css_class

Label icon CSS class

CSS class associated with label

Implementation:zope.schema.TextLine
Read Only:False
Required:True
Default Value:‘fa fa-fw fa-edit’
Allowed Type:str
click_handler

Button click handler

Javascript function called by button click

Implementation:zope.schema.TextLine
Read Only:False
Required:False
Default Value:None
Allowed Type:str
url

Button target URL

Target URL accessed by button click

Implementation:zope.schema.TextLine
Read Only:False
Required:False
Default Value:None
Allowed Type:str
modal_target

Modal target?

If True, target URL is opened in a modal frame

Implementation:zope.schema.Bool
Read Only:False
Required:False
Default Value:False
Allowed Type:bool
interface pyams_form.schema.ICloseButton[source]

Extends: z3c.form.interfaces.IButton

Close button interface

interface pyams_form.schema.IResetButton[source]

Extends: z3c.form.interfaces.IButton

Reset button interface

class pyams_form.schema.ResetButton(*args, **kwargs)[source]

Bases: z3c.form.button.Button

Reset button

pyams_form.security

pyams_form.terms

PyAMS_form.terms module

This module is used only to provide a custom ITerms adapter providing translations for boolean terms.

class pyams_form.terms.BoolTerms(context, request, form, field, widget)[source]

Bases: z3c.form.term.BoolTerms

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

falseLabel = 'no'
trueLabel = 'yes'

pyams_form.viewlet