FormModel
Overview
This component is a form model that renders fields based on the configuration for the model.
Theme entry: FormModel
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| themeOverride | Object | null | A partial ThemeObject keyed by component name, merged over this component's theme and provided to descendants. | |
| app | string | yes | Django app label that owns the model. | |
| model | string | yes | Django model name to render a form for. | |
| view | string | undefined | View identifier used to select view-specific form configuration; uses the default configuration when omitted. | |
| fields | array | undefined | Field names to render; overrides the configuration default for this view. | |
| expand | array | undefined | Field names to render in expanded (inline) mode. | |
| computedFields | array | undefined | Field names to render as computed fields: read-only, in FormField, and outside the form context. Replaces the model config computedFields list for this form. | |
| variant | string | "default" | Visual variant for the theme system. A function-form FormModel theme entry receives it as { variant }, so a project can register an alternate form style for each variant. | |
| fieldComponents | object | undefined | Map of field paths to async functions returning an override field component. | |
| fieldProps | object | undefined | Map of field paths to additional props passed to the field component. | |
| fieldDetails | object | undefined | Map of field paths to field detail overrides merged with server configuration. | |
| expandDetails | object | undefined | Map of expand field paths to detail overrides. | |
| widgetComponents | object | undefined | Map of field paths to async functions returning an override widget component. | |
| widgetProps | object | undefined | Map of field paths to additional props passed to the widget component. |
Slots
| Name | Scoped | Description |
|---|---|---|
before-fields | yes | |
form-level-chores | ||
fields | yes | fields Replace the default field loop. Render each field with FormModelField so the per-field slots reach it. |
after-fields | yes |
Source
client/lib/form/form-model/FormModel.vue