You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/backend/schemas.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -224,10 +224,10 @@ Note this won't have behavior fields added to it at this stage, only the fields
224
224
With `plone.autoform` and `plone.supermodel` we can use directives to add information to the schema fields.
225
225
226
226
227
-
### Omitting fields
227
+
### Omit fields
228
228
229
229
A field can be omitted entirely from all forms, or from some forms, using the `omitted` and `no_omit` directives.
230
-
In this example, the `dummy` field is omitted from all forms, and the `edit_only` field is omitted from all forms except those that provide the IEditForm interface:
230
+
In this example, the `dummy` field is omitted from all forms, and the `edit_only` field is omitted from all forms except those that provide the `IEditForm` interface:
231
231
232
232
```{code-block} python
233
233
:emphasize-lines: 7,12,13
@@ -239,15 +239,15 @@ from plone.autoform import directives as form
239
239
240
240
class IMySchema(model.Schema):
241
241
242
-
form.omitted('dummy')
242
+
form.omitted("dummy")
243
243
dummy = schema.Text(
244
244
title=u"Dummy"
245
245
)
246
246
247
-
form.omitted('edit_only')
248
-
form.no_omit(IEditForm, 'edit_only')
247
+
form.omitted("edit_only")
248
+
form.no_omit(IEditForm, "edit_only")
249
249
edit_only = schema.TextLine(
250
-
title = u'Only included on edit forms',
250
+
title = u"Only included on edit forms",
251
251
)
252
252
```
253
253
@@ -272,7 +272,7 @@ In supermodel XML, this can be specified as:
272
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
-
### Re-ordering fields
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
278
In this example, the `not_last` field is placed before the `summary` field even though it is defined afterward:
@@ -292,15 +292,15 @@ class IMySchema(model.Schema):
292
292
readonly=True
293
293
)
294
294
295
-
form.order_before(not_last='summary')
295
+
form.order_before(not_last="summary")
296
296
not_last = schema.TextLine(
297
297
title=u"Not last",
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.
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
304
Use an unprefixed name to refer to a field in the current or the default schema for the form.
305
305
306
306
In supermodel XML, the directives are called `form:before` and `form:after`.
@@ -345,7 +345,7 @@ class IMySchema(model.Schema):
345
345
)
346
346
```
347
347
348
-
In supermodel XML fieldsets are specified by grouping fields within a `<fieldset>` tag:
348
+
In supermodel XML, fieldsets are specified by grouping fields within a `<fieldset>` tag:
0 commit comments