Skip to content

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 ​

NameTypeRequiredDefaultDescription
themeOverrideObjectnullA partial ThemeObject keyed by component name, merged over this component's theme and provided to descendants.
appstringyesDjango app label that owns the model.
modelstringyesDjango model name used to resolve API endpoints and configuration.
variantstring"default"View variant key used to select the model configuration for this view.
formModelVariantstringundefinedTheme variant that the inner FormModel component receives as variant. Wins over a variant in the model config's formProps when passed.
classstring|array|object() => []CSS class(es) applied to the root element.
fieldComponentsobjectundefinedMap of field paths to async functions returning an override field component.
widgetComponentsobjectundefinedMap of field paths to async functions returning an override widget component.
formPropsobjectundefinedExtra 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.
fieldPropsobjectundefinedMap of field paths to additional props passed to the field component. Replaces a fieldProps map in the model config's formProps when passed.
widgetPropsobjectundefinedMap of field paths to additional props passed to the widget component. Replaces a widgetProps map in the model config's formProps when passed.
submitFieldsarrayundefinedField paths sent in the create request body; falls back to the model config's submitFields when omitted or empty.
fetchFieldsarrayundefinedField names the server returns in the create response; falls back to the model config's fetchFields when omitted or empty.
redirectAfterstring"update"Named view to redirect to after a successful create submission.

Slots ​

NameScopedDescription
before-fieldsyes
form-level-chores
fieldsyesfields Replace the default field loop. Render each field with FormModelField so the per-field slots reach it.
after-fieldsyes
targetless-action-buttonyes
submit-buttonyes
form-confirm-dialog-warningsyes
warning-entryyes

Full slot reference

Events ​

form-object ​

form-context ​

Source ​

client/lib/views/ViewCreate.vue