ViewCreate
Overview
Form view for creating a new model instance, including a page title, a sticky submit button bar, and a FormModel that renders the configured fields.
Theme entry: ViewCreate
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 used to resolve API endpoints and configuration. | |
| variant | string | "default" | View variant key used to select the model configuration for this view. | |
| formModelVariant | string | undefined | Theme variant that the inner FormModel component receives as variant. Wins over a variant in the model config's formProps when passed. | |
| class | string|array|object | () => [] | CSS class(es) applied to the root element. | |
| fieldComponents | object | undefined | Map of field paths to async functions returning an override field component. | |
| widgetComponents | object | undefined | Map of field paths to async functions returning an override widget component. | |
| formProps | object | undefined | Extra props for the inner FormModel component. They win over the model config's formProps and lose to this view's own form props. The app, model, and view keys are ignored, because the view sets them. | |
| fieldProps | object | undefined | Map of field paths to additional props passed to the field component. Replaces a fieldProps map in the model config's formProps when passed. | |
| widgetProps | object | undefined | Map of field paths to additional props passed to the widget component. Replaces a widgetProps map in the model config's formProps when passed. | |
| submitFields | array | undefined | Field paths sent in the create request body; falls back to the model config's submitFields when omitted or empty. | |
| fetchFields | array | undefined | Field names the server returns in the create response; falls back to the model config's fetchFields when omitted or empty. | |
| redirectAfter | string | "update" | Named view to redirect to after a successful create submission. |
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 | |
targetless-action-button | yes | |
submit-button | yes | |
form-confirm-dialog-warnings | yes | |
warning-entry | yes |
Events
form-object
form-context
Source
client/lib/views/ViewCreate.vue