ModelActionForm
Overview
Wraps ActionForm to execute a named action (such as delete or a custom bulk operation) against one or more model instances. It displays the selected objects, a confirmation message, and handles submission, dry-run validation, and post-action redirect to the appropriate list or detail view.
Renders a tone-tracked confirmation card with a banner, a selected-objects chip-row panel, and a confirm-prompt panel. The page prop renders the same parts as a routed page instead: the confirm button moves into the sticky action bar and the parts sit in the page gutter, as the detail views lay out a page. The action views and ViewDestroy set page. The bare prop suppresses the card chrome and banner, for a host that wraps the form in a card of its own.
Theme entry: ModelActionForm
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| iconOverride | Object | null | A partial icon registry ({ [componentName]: { [iconName]: { component, props } } }) merged with inherited and default icon entries; scopes icon overrides to this component and its descendants. | |
| 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 the action targets. | |
| action | string | yes | Action identifier (e.g. "delete" or a custom action name) sent to the server. | |
| pk | string|number|array | undefined | Primary key or primary keys used when selected objects have not been fetched yet. | |
| actionVerboseName | string | undefined | Human-readable action name shown in confirmation and result messages; defaults to a title-cased version of action. | |
| actionSuccessSummary | string | undefined | Toast summary shown on successful action completion; auto-generated from the action and model name if omitted. | |
| actionErrorSummary | string | undefined | Toast summary shown when the action fails; auto-generated from the action and model name if omitted. | |
| confirmMessage | string | undefined | Confirmation message shown to the user before submitting; auto-generated from the action and model name if omitted. | |
| fetchState | object | undefined | Reactive fetch state object providing the list of selected objects and their data. Without it, the form looks the selected records up by primary key so its chips can show their formatted names. That lookup is for display only and never changes which records the action targets. | |
| instanceList | object | undefined | reactive-helpers list instance holding the selected objects. Bulk actions use it so a real destroy reconciles the rows the caller is showing. Omit it to use a private transport-only list. | |
| transformSubmitDataFn | func | undefined | Optional function to transform form values before they are sent in the request body. | |
| requestMethod | string | "PUT" | HTTP method used for the action request (ignored for destroy actions, which always use DELETE). | |
| enableDryRun | boolean | true | When true, performs a dry-run validation request before the final submission. | |
| tone | string | "info" | Sentiment tone that drives the banner and card accents. One of info (default confirmations), success (activate / restore), warning (irreversible non-destructive), or danger (destructive). danger also gives the default confirm button the destructive tone; the others keep it primary. Routed via data-tone on the card root and consumed by Tailwind v4 group-data-[tone=…]/model-action-form: variants. | |
string | undefined | Optional banner title; defaults to a sentence built from action + model name. | ||
string | undefined | Optional banner description; defaults to "Review the selected records before continuing." | ||
| bare | boolean | false | When true, suppress the card chrome and tone-tracked banner, for a host that wraps the form in a card of its own. | |
| page | boolean | false | When true, the form fills a view's page rather than sitting in a card. The confirm button moves into a top-zone StickyBar beside the page title, and the cancel button is left out, because the view's Go Back action already leaves the page. Without bare, the card chrome is also dropped: the banner, selected records, and confirm prompt sit directly in the view's gutter. | |
| confirmText | string | undefined | Literal phrase the operator must type before the confirm button enables. When set, a TypedConfirmField renders inside the body (after any extra-fields slot content) and the submit button is gated until the typed value matches. Leave undefined to skip the type-to-confirm gate. |
Slots
| Name | Scoped | Description |
|---|---|---|
confirm-button | yes | |
action-banner | yes | Override the tone-tracked banner shown above the confirmation body. Only rendered when bare is false. |
banner-meta | yes | |
selected-objects | yes | Override the list of selected objects shown above the confirmation form. |
link-item | yes | Override the link rendered for each selected object in the default list. |
confirm-message | Override the confirmation prompt shown before submitting. | |
extra-fields | yes | |
form-confirm-dialog-warnings | yes | |
warning-entry | yes |
Source
client/lib/views/ModelActionForm.vue