Skip to content

Commit e888ed8

Browse files
committed
improve form section
1 parent d203370 commit e888ed8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/classic-ui/forms.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Fields, Widgets, Vocabularies aso are descripted in detail in there own chapter
1919
Plone uses the [z3c.form](http://pythonhosted.org/z3c.form) library to build its web-forms.
2020
The packages responsible for integrating with Plone are [plone.z3cform](https://github.com/plone//plone.z3cform) and [plone.app.z3cform](https://github.com/plone/plone.app.z3cform) which contains most of the widgets and default templates. To simplify the process of organizing a form and specifying its widgets and fields, Plone utilizes [plone.autoform](https://github.com/plone/plone.autoform), in particular its `AutoExtensibleForm` base class. It is responsible for handling form hints and configuring z3c.form widgets and groups (fieldsets).
2121

22-
A form is a view that utilizes these libraries.
22+
A form is a view that utilizes these libraries to auto generate forms.
23+
2324

2425

2526
(classic-ui-forms-general-forms-label)=
@@ -95,6 +96,23 @@ class MyForm(AutoExtensibleForm, form.EditForm):
9596

9697
```
9798

99+
Our form `MyForm` is a sub class of the z3c.form base class `z3c.form.form.EditForm` and `plone.autoform.form.AutoExtensibleForm` which add some convenient methods to organize the form fields and widgets.
100+
Besides some basic properties like `label` and `description`, the more interesting properties are `schema` and `ignoreContext`.
101+
102+
### configuring the form
103+
104+
#### schema
105+
106+
The schema property points to a schema interface, which defines the fields of our form.
107+
108+
```
109+
schema = IMyForm
110+
```
111+
112+
### ignoreContext
113+
114+
If your form is not bound to an object (like a Dexterity object), set `ignoreContext = True`.
115+
98116

99117
(classic-ui-forms-dexterity-add-edit-forms-label)=
100118
## Dexterity Add- and Edit forms

0 commit comments

Comments
 (0)