Interfaces¶
Model interfaces¶
Form and Widget Framework Interfaces
-
interface
z3c.form.interfaces.
IFormLayer
[source]¶ A layer that contains all registrations of this package.
It is intended that someone can just use this layer as a base layer when using this package.
Since version 2.4.2, this layer doesn’t provide IBrowserRequst anymore. This makes it possible to use the IFormLayer within z3c.jsonrpc without to apply the IBrowserRequest into the jsonrpc request.
-
interface
z3c.form.interfaces.
IManager
[source]¶ Extends:
zope.interface.common.mapping.IEnumerableMapping
A manager of some kind of items.
- Important: While managers are mappings, the order of the items is
- assumed to be important! Effectively a manager is an ordered mapping.
In general, managers do not have to support a manipulation API. Oftentimes, managers are populated during initialization or while updating.
-
interface
z3c.form.interfaces.
ISelectionManager
[source]¶ Extends:
z3c.form.interfaces.IManager
Managers that support item selection and management.
This manager allows one to more carefully specify the contained items.
Important: The API is chosen in a way, that the manager is still immutable. All methods in this interface must return new instances of the manager.
-
__add__
(other)¶ Used for merge two managers.
-
select
(*names)¶ Return a modified instance with an ordered subset of items.
-
omit
(*names)¶ Return a modified instance omitting given items.
-
copy
()¶ Copy all items to a new instance and return it.
-
-
interface
z3c.form.interfaces.
IData
[source]¶ A proxy object for form data.
The object will make all keys within its data attribute available as attributes. The schema that is represented by the data will be directly provided by instances.
-
__init__
(schema, data, context)¶ The data proxy is instantiated using the schema it represents, the data fulfilling the schema and the context in which the data are validated.
-
__context__
¶ Context
The context in which the data are validated.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
-
interface
z3c.form.interfaces.
IValidator
[source]¶ A validator for a particular value.
-
validate
(value, force=False)¶ Validate the value.
If successful, return
None
. Otherwise raise anInvalid
error.
-
-
interface
z3c.form.interfaces.
IManagerValidator
[source]¶ A validator that validates a set of data.
-
validate
(data)¶ Validate a dictionary of data.
This method is only responsible of validating relationships between the values in the data. It can be assumed that all values have been validated in isolation before.
The return value of this method is a tuple of errors that occurred during the validation process.
-
validateObject
(obj)¶ Validate an object.
The same semantics as in
validate()
apply, except that the values are retrieved from the object and not the data dictionary.
-
-
interface
z3c.form.interfaces.
IErrorViewSnippet
[source]¶ A view providing a view for an error
-
widget
¶ Widget
The widget that the view is on
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
error
¶ Error
Error the view is for.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
update
()¶ Update view.
-
render
()¶ Render view.
-
-
interface
z3c.form.interfaces.
IMultipleErrors
[source]¶ An error that contains many errors
-
errors
¶ List of errors
-
-
interface
z3c.form.interfaces.
IField
[source]¶ Field wrapping a schema field used in the form.
-
__name__
¶ Title
The name of the field within the form.
Implementation: zope.schema.TextLine
Read Only: False Required: True Default Value: None Allowed Type: str
-
field
¶ Schema Field
The schema field that is to be rendered.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
prefix
¶ Prefix
The prefix of the field used to avoid name clashes.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
mode
¶ Mode
The mode in which to render the widget for the field.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
interface
¶ Interface
The interface from which the field is coming.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
ignoreContext
¶ Ignore Context
A flag, when set, forces the widget not to look at the context for a value.
Implementation: zope.schema.Bool
Read Only: False Required: False Default Value: None Allowed Type: bool
-
widgetFactory
¶ Widget Factory
The widget factory.
Implementation: zope.schema.Field
Read Only: False Required: False Default Value: None
-
-
interface
z3c.form.interfaces.
IFields
[source]¶ Extends:
z3c.form.interfaces.ISelectionManager
IField manager.
-
select
(prefix=None, interface=None, *names)¶ Return a modified instance with an ordered subset of items.
This extension to the
ISelectionManager
allows for handling cases with name-conflicts better by separating field selection and prefix specification.
-
omit
(prefix=None, interface=None, *names)¶ Return a modified instance omitting given items.
This extension to the
ISelectionManager
allows for handling cases with name-conflicts better by separating field selection and prefix specification.
-
-
interface
z3c.form.interfaces.
IContentProviders
[source]¶ Extends:
z3c.form.interfaces.IManager
A content provider manager
-
interface
z3c.form.interfaces.
IDataManager
[source]¶ Data manager.
-
get
()¶ Get the value.
If no value can be found, raise an error
-
query
(default=<NO_VALUE>)¶ Get the value.
If no value can be found, return the default value. If access is forbidden, raise an error.
-
set
(value)¶ Set the value
-
canAccess
()¶ Can the value be accessed.
-
canWrite
()¶ Can the data manager write a value.
-
-
interface
z3c.form.interfaces.
IDataConverter
[source]¶ A data converter from field to widget values and vice versa.
-
toWidgetValue
(value)¶ Convert the field value to a widget output value.
If conversion fails or is not possible, a
ValueError
must be raised. However, this method should effectively never fail, because incoming value is well-defined.
-
toFieldValue
(value)¶ Convert an input value to a field/system internal value.
This methods must also validate the converted value against the field.
If the conversion fails, a
ValueError
must be raised. If the validation fails, aValidationError
must be raised.
-
-
interface
z3c.form.interfaces.
ITerms
[source]¶ -
context
¶ Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
request
¶ Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
form
¶ Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
field
¶ Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
widget
¶ Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
getTerm
(value)¶ Return an ITitledTokenizedTerm object for the given value
LookupError is raised if the value isn’t in the source
-
getTermByToken
(token)¶ Return an ITokenizedTerm for the passed-in token.
If token is not represented in the vocabulary, LookupError is raised.
-
getValue
(token)¶ Return a value for a given identifier token
LookupError is raised if there isn’t a value in the source.
-
__iter__
()¶ Iterate over terms.
-
__len__
()¶ Return number of terms.
-
__contains__
(value)¶ Check wether terms containes the
value
.
-
-
interface
z3c.form.interfaces.
IBoolTerms
[source]¶ Extends:
z3c.form.interfaces.ITerms
A specialization that handles boolean choices.
-
interface
z3c.form.interfaces.
IObjectFactory
[source]¶ Factory that will instantiate our objects for ObjectWidget. It could also pre-populate properties as it gets the values extracted from the form passed in
value
.-
__call__
(value)¶ Return a default object created to be populated.
-
-
interface
z3c.form.interfaces.
IWidgetLayoutTemplate
[source]¶ Widget layout template marker used for render the widget layout.
It is important that we don’t inherit this template from IPageTemplate. otherwise we will get into trouble since we lookup an IPageTemplate in the widget/render method.
-
interface
z3c.form.interfaces.
IWidget
[source]¶ Extends:
zope.location.interfaces.ILocation
A widget within a form
-
name
¶ Name
The name the widget is known under.
Implementation: zope.schema.ASCIILine
Read Only: False Required: True Default Value: None Allowed Type: str
-
label
¶ Label
The widget label.
Label may be translated for the request.
The attribute may be implemented as either a read-write or read-only property, depending on the requirements for a specific implementation.
Implementation: zope.schema.TextLine
Read Only: False Required: True Default Value: None Allowed Type: str
-
mode
¶ Mode
A widget mode.
Implementation: zope.schema.ASCIILine
Read Only: False Required: True Default Value: ‘input’ Allowed Type: str
-
required
¶ Required
If true the widget should be displayed as required input.
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
error
¶ Error
If an error occurred during any step, the error view stored here.
Implementation: zope.schema.Field
Read Only: False Required: False Default Value: None
-
value
¶ Value
The value that the widget represents.
Implementation: zope.schema.Field
Read Only: False Required: False Default Value: None
-
template
¶ The widget template
-
layout
¶ The widget layout template
-
ignoreRequest
¶ Ignore Request
A flag, when set, forces the widget not to look at the request for a value.
Implementation: zope.schema.Bool
Read Only: False Required: False Default Value: False Allowed Type: bool
-
setErrors
¶ Set errors
A flag, when set, the widget sets error messages on calling extract().
Implementation: zope.schema.Bool
Read Only: False Required: False Default Value: True Allowed Type: bool
-
ignoreRequiredOnValidation
¶ Ignore Required validation
If set then required fields will pass validation regardless whether they’re filled in or not
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
showDefault
¶ Show default value
A flag, when set, makes the widget to displayfield|adapter provided default values.
Implementation: zope.schema.Bool
Read Only: False Required: False Default Value: True Allowed Type: bool
-
extract
(default=<NO_VALUE>)¶ Extract the string value(s) of the widget from the form.
The return value may be any Python construct, but is typically a simple string, sequence of strings or a dictionary.
The value must not be converted into a native format.
If an error occurs during the extraction, the default value should be returned. Since this should never happen, if the widget is properly designed and used, it is okay to NOT raise an error here, since we do not want to crash the system during an inproper request.
If there is no value to extract, the default is to be returned.
-
update
()¶ Setup all of the widget information used for displaying.
-
render
()¶ Render the plain widget without additional layout
-
json_data
()¶ Returns a dictionary for the widget
-
__call__
()¶ Render a layout template which is calling widget/render
-
-
interface
z3c.form.interfaces.
ISequenceWidget
[source]¶ Extends:
z3c.form.interfaces.IWidget
Term based sequence widget base.
The sequence widget is used for select items from a sequence. Don’t get confused, this widget does support to choose one or more values from a sequence. The word sequence is not used for the schema field, it’s used for the values where this widget can choose from.
This widget base class is used for build single or sequence values based on a sequence which is in most use case a collection. e.g. IList of IChoice for sequence values or IChoice for single values.
See also the MultiWidget for build sequence values based on none collection based values. e.g. IList of ITextLine
-
noValueToken
¶ NO_VALUE Token
The token to be used, if no value has been selected.
Implementation: zope.schema.ASCIILine
Read Only: False Required: True Default Value: None Allowed Type: str
-
terms
¶ Terms
A component that provides the options for selection.
Implementation: zope.schema.Object
Read Only: False Required: True Default Value: None Must Provide: z3c.form.interfaces.ITerms
-
updateTerms
()¶ Update the widget’s
terms
attribute and return the terms.This method can be used by external components to get the terms without having to worry whether they are already created or not.
-
-
interface
z3c.form.interfaces.
IMultiWidget
[source]¶ Extends:
z3c.form.interfaces.IWidget
None Term based sequence widget base.
The multi widget is used for ITuple, IList or IDict if no other widget is defined.
Some IList or ITuple are using another specialized widget if they can choose from a collection. e.g. a IList of IChoice. The base class of such widget is the ISequenceWidget.
This widget can handle none collection based sequences and offers add or remove values to or from the sequence. Each sequence value get rendered by it’s own relevant widget. e.g. IList of ITextLine or ITuple of IInt
-
interface
z3c.form.interfaces.
ISelectWidget
[source]¶ Extends:
z3c.form.interfaces.ISequenceWidget
Select widget with ITerms option.
-
prompt
¶ Prompt
A flag, when set, enables a choice explicitely requesting the user to choose a value.
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
items
¶ Items
A collection of dictionaries containing all pieces of information for rendering. The following keys must be in each dictionary: id, value, content, selected
Implementation: zope.schema.Tuple
Read Only: False Required: True Default Value: None Allowed Type: tuple
-
-
interface
z3c.form.interfaces.
IOrderedSelectWidget
[source]¶ Extends:
z3c.form.interfaces.ISequenceWidget
Ordered Select widget with ITerms option.
-
interface
z3c.form.interfaces.
ICheckBoxWidget
[source]¶ Extends:
z3c.form.interfaces.ISequenceWidget
Checbox widget.
-
interface
z3c.form.interfaces.
ISingleCheckBoxWidget
[source]¶ Extends:
z3c.form.interfaces.ICheckBoxWidget
Single Checbox widget.
-
interface
z3c.form.interfaces.
IRadioWidget
[source]¶ Extends:
z3c.form.interfaces.ISequenceWidget
Radio widget.
-
renderForValue
(value)¶ Render a single radio button element for a given value.
Here the word
value
is used in the HTML sense, in other words it is a term token.
-
-
interface
z3c.form.interfaces.
ISubmitWidget
[source]¶ Extends:
z3c.form.interfaces.IWidget
Submit widget.
-
interface
z3c.form.interfaces.
IImageWidget
[source]¶ Extends:
z3c.form.interfaces.IWidget
Submit widget.
-
interface
z3c.form.interfaces.
IButtonWidget
[source]¶ Extends:
z3c.form.interfaces.IWidget
Button widget.
-
interface
z3c.form.interfaces.
ITextAreaWidget
[source]¶ Extends:
z3c.form.interfaces.IWidget
Text widget.
-
interface
z3c.form.interfaces.
ITextLinesWidget
[source]¶ Extends:
z3c.form.interfaces.IWidget
Text lines widget.
-
interface
z3c.form.interfaces.
ITextWidget
[source]¶ Extends:
z3c.form.interfaces.IWidget
Text widget.
-
interface
z3c.form.interfaces.
IFileWidget
[source]¶ Extends:
z3c.form.interfaces.ITextWidget
File widget.
-
interface
z3c.form.interfaces.
IPasswordWidget
[source]¶ Extends:
z3c.form.interfaces.ITextWidget
Password widget.
-
interface
z3c.form.interfaces.
IObjectWidget
[source]¶ Extends:
z3c.form.interfaces.IWidget
Object widget.
-
setupFields
()¶ setup fields on the widget, by default taking the fields of self.schema
-
-
interface
z3c.form.interfaces.
IWidgets
[source]¶ Extends:
z3c.form.interfaces.IManager
A widget manager
-
prefix
¶ Prefix
The prefix of the widgets.
Implementation: zope.schema.ASCIILine
Read Only: False Required: True Default Value: ‘widgets.’ Allowed Type: str
-
mode
¶ Prefix
The prefix of the widgets.
Implementation: zope.schema.ASCIILine
Read Only: False Required: True Default Value: ‘input’ Allowed Type: str
-
errors
¶ Errors
The collection of errors that occured during validation.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: ()
-
ignoreContext
¶ Ignore Context
If set the context is ignored to retrieve a value.
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
ignoreRequest
¶ Ignore Request
If set the request is ignored to retrieve a value.
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
ignoreReadonly
¶ Ignore Readonly
If set then readonly fields will also be shown.
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
ignoreRequiredOnExtract
¶ Ignore Required validation on extract
If set then required fields will pass validation on extract regardless whether they’re filled in or not
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
hasRequiredFields
¶ Has required fields
A flag set when at least one field is marked as required
Implementation: zope.schema.Bool
Read Only: False Required: False Default Value: False Allowed Type: bool
-
setErrors
¶ Set errors
A flag, when set, the contained widgets set error messages on calling extract().
Implementation: zope.schema.Bool
Read Only: False Required: False Default Value: True Allowed Type: bool
-
update
()¶ Setup widgets.
-
extract
()¶ Extract the values from the widgets and validate them.
-
extractRaw
()¶ Extract the RAW/string values from the widgets and validate them.
-
-
interface
z3c.form.interfaces.
IFieldWidget
[source]¶ Offers a field attribute.
For advanced uses the widget will make decisions based on the field it is rendered for.
-
field
¶ Field
The schema field which the widget is representing.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
-
exception
z3c.form.interfaces.
ActionExecutionError
(error)[source]¶ Bases:
Exception
An error that occurs during the execution of an action handler.
-
exception
z3c.form.interfaces.
WidgetActionExecutionError
(widgetName, error)[source]¶ Bases:
z3c.form.interfaces.ActionExecutionError
An action execution error that occurred due to a widget value being incorrect.
-
interface
z3c.form.interfaces.
IAction
[source]¶ Action
-
__name__
¶ Name
The object name.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
title
¶ Title
The action title.
Implementation: zope.schema.TextLine
Read Only: False Required: True Default Value: None Allowed Type: str
-
isExecuted
()¶ Determine whether the action has been executed.
-
-
interface
z3c.form.interfaces.
IActionEvent
[source]¶ An event specific for an action.
-
action
¶ Action
The action for which the event is created.
Implementation: zope.schema.Object
Read Only: False Required: True Default Value: None Must Provide: z3c.form.interfaces.IAction
-
-
interface
z3c.form.interfaces.
IActionErrorEvent
[source]¶ Extends:
z3c.form.interfaces.IActionEvent
An action event that is created when an error occurred.
-
error
¶ Error
The error that occurred during the action.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
-
interface
z3c.form.interfaces.
IActions
[source]¶ Extends:
z3c.form.interfaces.IManager
A action manager
-
executedActions
¶ An iterable of all executed actions (usually just one).
-
update
()¶ Setup actions.
-
execute
()¶ Exceute actions.
If an action execution error is raised, the system is notified using the action occurred error; on the other hand, if successful, the action successfull event is sent to the system.
-
-
interface
z3c.form.interfaces.
IButton
[source]¶ Extends:
zope.schema.interfaces.IField
A button in a form.
-
accessKey
¶ Access Key
The key when pressed causes the button to be pressed.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
actionFactory
¶ Action Factory
The action factory.
Implementation: zope.schema.Field
Read Only: False Required: False Default Value: None
-
-
interface
z3c.form.interfaces.
IImageButton
[source]¶ Extends:
z3c.form.interfaces.IButton
An image button in a form.
-
interface
z3c.form.interfaces.
IButtons
[source]¶ Extends:
z3c.form.interfaces.ISelectionManager
Button manager.
-
interface
z3c.form.interfaces.
IButtonAction
[source]¶ Extends:
z3c.form.interfaces.IAction
,z3c.form.interfaces.IWidget
,z3c.form.interfaces.IFieldWidget
Button action.
-
interface
z3c.form.interfaces.
IButtonHandlers
[source]¶ A collection of handlers for buttons.
-
addHandler
(button, handler)¶ Add a new handler for a button.
-
getHandler
(button)¶ Get the handler for the button.
-
copy
()¶ Copy this object and return the copy.
-
__add__
(other)¶ Add another handlers object.
During the process a copy of the current handlers object should be created and the other one is added to the copy. The return value is the copy.
-
-
interface
z3c.form.interfaces.
IButtonHandler
[source]¶ A handler managed by the button handlers.
-
__call__
(form, action)¶ Execute the handler.
-
-
interface
z3c.form.interfaces.
IHandlerForm
[source]¶ A form that stores the handlers locally.
-
handlers
¶ Handlers
A list of action handlers defined on the form.
Implementation: zope.schema.Object
Read Only: False Required: True Default Value: None Must Provide: z3c.form.interfaces.IButtonHandlers
-
-
interface
z3c.form.interfaces.
IActionForm
[source]¶ A form that stores executable actions
-
actions
¶ Actions
A list of actions defined on the form
Implementation: zope.schema.Object
Read Only: False Required: True Default Value: None Must Provide: z3c.form.interfaces.IActions
-
-
interface
z3c.form.interfaces.
IContextAware
[source]¶ Offers a context attribute.
For advanced uses, the widget will make decisions based on the context it is rendered in.
-
context
¶ Context
The context in which the widget is displayed.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
-
interface
z3c.form.interfaces.
IFormAware
[source]¶ Offers a form attribute.
For advanced uses the widget will make decisions based on the form it is rendered in.
-
form
¶ Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
-
interface
z3c.form.interfaces.
IForm
[source]¶ Form
-
mode
¶ Mode
The mode in which to render the widgets.
Implementation: zope.schema.Field
Read Only: False Required: True Default Value: None
-
ignoreContext
¶ Ignore Context
If set the context is ignored to retrieve a value.
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
ignoreRequest
¶ Ignore Request
If set the request is ignored to retrieve a value.
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
ignoreReadonly
¶ Ignore Readonly
If set then readonly fields will also be shown.
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
ignoreRequiredOnExtract
¶ Ignore Required validation on extract
If set then required fields will pass validation on extract regardless whether they’re filled in or not
Implementation: zope.schema.Bool
Read Only: False Required: True Default Value: False Allowed Type: bool
-
widgets
¶ Widgets
A widget manager containing the widgets to be used in the form.
Implementation: zope.schema.Object
Read Only: False Required: True Default Value: None Must Provide: z3c.form.interfaces.IWidgets
-
label
¶ Label
A human readable text describing the form that can be used in the UI.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
labelRequired
¶ Label required
A human readable text describing the form that can be used in the UI for rendering a required info legend.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
prefix
¶ Prefix
The prefix of the form used to uniquely identify it.
Implementation: zope.schema.ASCIILine
Read Only: False Required: True Default Value: ‘form.’ Allowed Type: str
-
status
¶ Status
The status message of the form.
Implementation: zope.schema.Text
Read Only: False Required: False Default Value: None Allowed Type: str
-
getContent
()¶ Return the content to be displayed and/or edited.
-
updateWidgets
(prefix=None)¶ Update the widgets for the form.
This method is commonly called from the
update()
method and is mainly meant to be a hook for subclasses.Note that you can pass an argument for
prefix
to override the default value of"widgets."
.
-
extractData
(setErrors=True)¶ Extract the data of the form.
setErrors: needs to be passed to extract() and to sub-widgets
-
update
()¶ Update the form.
-
render
()¶ Render the form.
-
json
()¶ Returns the form in json format
-
-
interface
z3c.form.interfaces.
ISubForm
[source]¶ Extends:
z3c.form.interfaces.IForm
A subform.
-
interface
z3c.form.interfaces.
IDisplayForm
[source]¶ Extends:
z3c.form.interfaces.IForm
Mark a form as display form, used for templates.
-
interface
z3c.form.interfaces.
IInputForm
[source]¶ A form that is meant to process the input of the form controls.
-
action
¶ Action
The action defines the URI to which the form data are sent.
Implementation: zope.schema.URI
Read Only: False Required: True Default Value: None Allowed Type: str
-
name
¶ Name
The name of the form used to identify it.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
id
¶ Id
The id of the form used to identify it.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
method
¶ Method
The HTTP method used to submit the form.
Implementation: zope.schema.Choice
Read Only: False Required: False Default Value: ‘post’
-
enctype
¶ Encoding Type
The data encoding used to submit the data safely.
Implementation: zope.schema.ASCIILine
Read Only: False Required: False Default Value: ‘multipart/form-data’ Allowed Type: str
-
-
interface
z3c.form.interfaces.
IAddForm
[source]¶ Extends:
z3c.form.interfaces.IForm
A form to create and add a new component.
-
create
(data)¶ Create the new object using the given data.
Returns the newly created object.
-
add
(object)¶ Add the object somewhere.
-
createAndAdd
(data)¶ Call create and add.
This method can be used for keep all attributes internal during create and add calls. On sucess we return the new created and added object. If something fails, we return None. The default handleAdd method will only set the _finishedAdd marker on sucess.
-
-
interface
z3c.form.interfaces.
IEditForm
[source]¶ Extends:
z3c.form.interfaces.IForm
A form to edit data of a component.
-
applyChanges
(data)¶ Apply the changes to the content component.
-
-
interface
z3c.form.interfaces.
IFieldsForm
[source]¶ Extends:
z3c.form.interfaces.IForm
A form that is based upon defined fields.
-
fields
¶ Fields
A field manager describing the fields to be used for the form.
Implementation: zope.schema.Object
Read Only: False Required: True Default Value: None Must Provide: z3c.form.interfaces.IFields
-
-
interface
z3c.form.interfaces.
IFieldsAndContentProvidersForm
[source]¶ Extends:
z3c.form.interfaces.IForm
A form that is based upon defined fields and content providers
-
contentProviders
¶ Content providers
A manager describing the content providers to be used for the form.
Implementation: zope.schema.Object
Read Only: False Required: True Default Value: None Must Provide: z3c.form.interfaces.IContentProviders
-
-
interface
z3c.form.interfaces.
IButtonForm
[source]¶ Extends:
z3c.form.interfaces.IForm
A form that is based upon defined buttons.
Buttons
A button manager describing the buttons to be used for the form.
Implementation: zope.schema.Object
Read Only: False Required: True Default Value: None Must Provide: z3c.form.interfaces.IButtons
-
interface
z3c.form.interfaces.
IGroup
[source]¶ Extends:
z3c.form.interfaces.IForm
A group of fields/widgets within a form.
-
interface
z3c.form.interfaces.
IGroupForm
[source]¶ Extends:
z3c.form.interfaces.IForm
A form that supports groups.
-
interface
z3c.form.interfaces.
IWidgetEvent
[source]¶ A simple widget event.
-
widget
¶ Widget
The widget for which the event was created.
Implementation: zope.schema.Object
Read Only: False Required: True Default Value: None Must Provide: z3c.form.interfaces.IWidget
-
-
interface
z3c.form.interfaces.
IAfterWidgetUpdateEvent
[source]¶ Extends:
z3c.form.interfaces.IWidgetEvent
An event sent out after the widget was updated.
-
interface
z3c.form.interfaces.
IDataExtractedEvent
[source]¶ Event sent after data and errors are extracted from widgets.
-
data
¶ Extracted form data. Usually, the widgets extract field names from the request and return a dictionary of field names and field values.
-
errors
¶ Tuple of errors providing IErrorViewSnippet.
-
form
¶ Form instance.
-
Browser interfaces¶
Browser Widget Framework Interfaces
-
interface
z3c.form.browser.interfaces.
IHTMLCoreAttributes
[source]¶ The HTML element ‘core’ attributes.
-
id
¶ Id
This attribute assigns a name to an element. This name must be unique in a document.
Implementation: zope.schema.ASCIILine
Read Only: False Required: False Default Value: None Allowed Type: str
-
klass
¶ Class
This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
-
interface
z3c.form.browser.interfaces.
IHTMLI18nAttributes
[source]¶ The HTML element ‘i18n’ attributes.
-
interface
z3c.form.browser.interfaces.
IHTMLEventsAttributes
[source]¶ The HTML element ‘events’ attributes.
-
onclick
¶ On Click
The
onclick
event occurs when the pointing device button is clicked over an element.Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
ondblclick
¶ On Double-Click
The
ondblclick
event occurs when the pointing device button is double clicked over an element.Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
onmousedown
¶ On Mouse Down
The onmousedown event occurs when the pointing device button is pressed over an element.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
onmouseup
¶ On Mouse Up
The
onmouseup
event occurs when the pointing device button is released over an element.Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
onmouseover
¶ On Mouse Over
The
onmouseover
event occurs when the pointing device is moved onto an element.Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
onmousemove
¶ On Mouse Move
The
onmousemove
event occurs when the pointing device is moved while it is over an element.Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
onmouseout
¶ On Mouse Out
The
onmouseout
event occurs when the pointing device is moved away from an element.Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
onkeypress
¶ On Key Press
The
onkeypress
event occurs when a key is pressed and released over an element.Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
-
interface
z3c.form.browser.interfaces.
IHTMLFormElement
[source]¶ Extends:
z3c.form.browser.interfaces.IHTMLCoreAttributes
,z3c.form.browser.interfaces.IHTMLI18nAttributes
,z3c.form.browser.interfaces.IHTMLEventsAttributes
,z3c.form.browser.interfaces.IWidgetLayoutSupport
A generic form-related element including layout template support.
-
disabled
¶ Disabled
When set for a form control, this boolean attribute disables the control for user input.
Implementation: zope.schema.Choice
Read Only: False Required: False Default Value: None
-
tabindex
¶ Tab Index
This attribute specifies the position of the current element in the tabbing order for the current document. This value must be a number between 0 and 32767.
Implementation: zope.schema.Int
Read Only: False Required: False Default Value: None Allowed Type: int
-
onfocus
¶ On Focus
The
onfocus
event occurs when an element receives focus either by the pointing device or by tabbing navigation.Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
onblur
¶ On blur
The
onblur
event occurs when an element loses focus either by the pointing device or by tabbing navigation.Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
onchange
¶ On Change
The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
addClass
(klass)¶ Add a class to the HTML element.
The class must be added to the
klass
attribute.
-
-
interface
z3c.form.browser.interfaces.
IHTMLInputWidget
[source]¶ Extends:
z3c.form.browser.interfaces.IHTMLFormElement
A widget using the HTML INPUT element.
-
readonly
¶ Read-Only
When set for a form control, this boolean attribute prohibits changes to the control.
Implementation: zope.schema.Choice
Read Only: False Required: False Default Value: None
-
alt
¶ Alternate Text
For user agents that cannot display images, forms, or applets, this attribute specifies alternate text.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
-
interface
z3c.form.browser.interfaces.
IHTMLImageWidget
[source]¶ Extends:
z3c.form.browser.interfaces.IHTMLInputWidget
A widget using the HTML INPUT element with type ‘image’.
-
interface
z3c.form.browser.interfaces.
IHTMLTextInputWidget
[source]¶ Extends:
z3c.form.browser.interfaces.IHTMLFormElement
A widget using the HTML INPUT element (for text types).
-
size
¶ Size
This attribute tells the user agent the initial width of the control – in this case in characters.
Implementation: zope.schema.Int
Read Only: False Required: False Default Value: None Allowed Type: int
-
maxlength
¶ Maximum Length
This attribute specifies the maximum number of characters the user may enter.
Implementation: zope.schema.Int
Read Only: False Required: False Default Value: None Allowed Type: int
-
placeholder
¶ Placeholder Text
This attribute represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: None Allowed Type: str
-
autocapitalize
¶ Auto-Capitalization Control
This attribute controls whether the browser should automatically capitalize the input value.
Implementation: zope.schema.Choice
Read Only: False Required: False Default Value: None
-
-
interface
z3c.form.browser.interfaces.
IHTMLTextAreaWidget
[source]¶ Extends:
z3c.form.browser.interfaces.IHTMLFormElement
A widget using the HTML TEXTAREA element.
-
rows
¶ Rows
This attribute specifies the number of visible text lines.
Implementation: zope.schema.Int
Read Only: False Required: False Default Value: None Allowed Type: int
-
cols
¶ columns
This attribute specifies the visible width in average character widths.
Implementation: zope.schema.Int
Read Only: False Required: False Default Value: None Allowed Type: int
-
readonly
¶ Read-Only
When set for a form control, this boolean attribute prohibits changes to the control.
Implementation: zope.schema.Choice
Read Only: False Required: False Default Value: None
-
-
interface
z3c.form.browser.interfaces.
IHTMLSelectWidget
[source]¶ Extends:
z3c.form.browser.interfaces.IHTMLFormElement
A widget using the HTML SELECT element.
-
multiple
¶ Multiple
If set, this boolean attribute allows multiple selections.
Implementation: zope.schema.Choice
Read Only: False Required: False Default Value: None
-