A Formulator Form; this is the base class of all forms.
Move the group with name group
down in the list of groups.
Returns 1 if the move succeeded, 0 if it failed.
Change Formulator Forms
Check whether the form has a field of a certain id. Returns true if the field exists.
View
Get a list in field order in a particular group.
View
Returns a basic HTML rendering (in a table) of this form. For more sophisticated renderings you'll have to write DTML or ZPT code yourself.
You can supply an optional dict
argument; this should be a
dictionary (_
, the namespace stack, is legal). The
dictionary can contain data that should be pre-filled in the
form (indexed by field id). The optional REQUEST
argument
can contain raw form data, which will be used in case nothing
can be found in the dictionary (or if the dictionary does not
exist).
View
Get the HTML code for the start of a form. This produces a
<form>
tag with the action
and method
attributes
that have been set in the Form.
View
Get a list of all groups in the form, in group order.
View
Returns a list of all fields in the form (in all groups). The order of the fields will be field order in the groups, and the groups will be in the group order.
View
Validate all the fields in this form, looking in REQUEST for
the raw field values. If any ValidationError occurs, they are
caught and added to a list of errors; after all validations a
FormValidationError is then raised with this list of
ValidationErrors as the errors
attribute.
Returns a dictionary with as keys the field ids and as values
the validated and processed field values. In addition, the
validated fields will be added to REQUEST, as in
validate_to_request()
. This will always be done for all
fields that validated successfully, even if the validation of
other fields failed and a FormValidationError is raised.
Exceptions that are raised can be caught in the following way (also in through the web Python scripts):
from Products.Formulator.Errors import ValidationError, FormValidationError try: myform.validate_all_to_request(REQUEST) except FormValidationError, e: print 'error' # handle error 'e', which contains 'errors'
View
Get a field with a certain id.
View
Move the field with field_id
up in the group with name group
.
Returns 1 if move succeeded, 0 if it failed.
Change Formulator Forms
Validate all the fields in this form, looking in REQUEST for
the raw field values. If any ValidationError occurs, they are
caught and added to a list of errors; after all validations a
FormValidationError is then raised with this list of
ValidationErrors as the errors
attribute.
Returns a dictionary with as keys the field ids and as values the validated and processed field values.
Exceptions that are raised can be caught in the following way (also in through the web Python scripts):
from Products.Formulator.Errors import ValidationError, FormValidationError try: myform.validate_all(REQUEST) except FormValidationError, e: print 'error' # handle error 'e', which contains 'errors'
View
Move a number of field ids in the list field_ids
from from_group
to to_group
.
Returns 1 if move succeeded, 0 if it failed.
Change Formulator Forms
Retrieve validated form data from session (Core Session Tracking) into REQUEST.
View
Move the group with name group
up in the list of groups.
Returns 1 if the move succeeded, 0 if it failed
Change Formulator Forms
Validate all the fields in this form, looking in REQUEST for the raw field values. If any validation error occurs, ValidationError is raised and validation is stopped.
Returns a dictionary with as keys the field ids and as values the validated and processed field values.
Exceptions that are raised can be caught in the following way (also in through the web Python scripts):
from Products.Formulator.Errors import ValidationError try: myform.validate(REQUEST) except ValidationError, e: print 'error' # handle error 'e'
View
Validate all the fields in this form, looking in REQUEST for the raw field values. If any validation error occurs, ValidationError is raised and validation is stopped.
Returns a dictionary with as keys the field ids and as values the validated and processed field values. In addition, this result will also be added to REQUEST (also with the field ids as keys).
Exceptions that are raised can be caught in the following way (also in through the web Python scripts):
from Products.Formulator.Errors import ValidationError try: myform.validate_to_request(REQUEST) except ValidationError, e: print 'error' # handle error 'e'
View
Give an existing group with the name group
a new name. The
new name must be unique.
Returns 1 if the rename succeeded, 0 if it failed.
Change Formulator Forms
Get the code for the end of the form (</form>
).
View
Remove an existing group with the name group
. All fields that
may have been in the group will be moved to the end of the
first group. The first group can never be removed.
Returns 1 if the group could be removed, 0 if it failed.
Change Formulator Forms
Add a new group with the name group
. The new group must have
a unique name in this form and will be added to the bottom of the
list of groups.
Returns 1 if the new group could be added, 0 if it failed.
Change Formulator Forms
As get_fields()
, but instead returns a list of ids of all the fields.
View
Store any validated form data in REQUEST in a session object (Core Session Tracking).
View
Move the field with field_id
down in the group with name group
.
Returns 1 if move succeeded, 0 if it failed.
Change Formulator Forms