@@ -221,7 +221,7 @@ Note this won't have behavior fields added to it at this stage, only the fields
221
221
222
222
## Using schema directives
223
223
224
- With ` plone.autoform ` and ` plone.supermodel ` we can use directives to add information to the schema fields.
224
+ With ` plone.autoform ` and ` plone.supermodel ` , we can use directives to add information to the schema fields.
225
225
226
226
227
227
### Omit fields
@@ -269,13 +269,13 @@ In supermodel XML, this can be specified as:
269
269
</field>
270
270
```
271
271
272
- ` form:omitted ` may be either a single boolean value, or a space-separated list of form_interface: boolean pairs.
272
+ ` form:omitted ` may be either a single boolean value, or a space-separated list of ` < form_interface>:< boolean> ` pairs.
273
273
274
274
275
275
### Reorder fields
276
276
277
277
A field's position in the form can be influenced using the ` order_before ` and ` order_after ` directives.
278
- In this example, the ` not_last ` field is placed before the ` summary ` field even though it is defined afterward:
278
+ In this example, the ` not_last ` field is placed before the ` summary ` field, even though it is defined afterward:
279
279
280
280
``` {code-block} python
281
281
:emphasize-lines: 12
@@ -298,10 +298,10 @@ class IMySchema(model.Schema):
298
298
)
299
299
```
300
300
301
- The value passed to the directive may be either ` * ` ( indicating before or after all fields) or the name of another field.
302
- Use ` .fieldname ` to refer to field in the current schema or a base schema.
303
- Prefix with the schema name (e.g. ` IDublinCore.title ` ) to refer to a field in another schema.
304
- Use an unprefixed name to refer to a field in the current or the default schema for the form.
301
+ The value passed to the directive may be either ` * ` , indicating before or after all fields, or the name of another field.
302
+ Use ` < .fieldname> ` to refer to the field in the current schema or a base schema.
303
+ Prefix with the schema name, such as ` IDublinCore.title ` , to refer to a field in another schema.
304
+ Use an unprefixed name to refer to a field in either the current or default schema for the form.
305
305
306
306
In supermodel XML, the directives are called ` form:before ` and ` form:after ` .
307
307
For example:
@@ -323,17 +323,17 @@ Fields can be grouped into fieldsets, which will be rendered within an HTML `<fi
323
323
In this example the ` footer ` and ` dummy ` fields are placed within the ` extra ` fieldset:
324
324
325
325
``` {code-block} python
326
- :emphasize-lines: 6,7,8, 9
326
+ :emphasize-lines: 6- 9
327
327
:linenos:
328
328
329
329
from plone.supermodel import model
330
330
from plone.autoform import directives as form
331
331
332
332
class IMySchema(model.Schema):
333
333
334
- model.fieldset(' extra' ,
334
+ model.fieldset(" extra" ,
335
335
label=u"Extra info",
336
- fields=[' footer', ' dummy' ]
336
+ fields=[" footer", " dummy" ]
337
337
)
338
338
339
339
footer = schema.Text(
0 commit comments