ListActionMixin

class djcrud.views.list_action.ListActionMixin[source]

Bases: ModelMixin, FormMixin, ObjectListPermissionMixin

Bulk actions from the list action bar (selected row PKs in pks).

Brings in ObjectListPermissionMixin so that when combined with ActionMixin (as ListActionView does), per-target permission checks (general shortcode + has_permission_object() per row) are performed against each row in self.object_list.

The bar itself lists configured LIST_ACTION routes (see list_actions, which walks tagged routes directly with no permission check). Per-object allowance (always checked with a concrete object) is propagated via data-list-actions on checkboxes and filtered client-side.

tags

Must include djcrud.tags.LIST_ACTION for discovery.

Type:

list[str]

title

Action label in the list action bar.

Type:

str

icon

Bootstrap Icons name.

Type:

str

color

Bulma button colour modifier.

Type:

str

message

Confirmation text in the action modal.

Type:

str

form_class

Form class for the action. Default empty Form.

Type:

type

get_queryset()[source]

Scoped queryset from the enclosing router.

property pks

Selected primary keys from GET or POST.

property object_list

Intersection of pks with the scoped queryset.

property invalid_pks

Count of PKs outside the scoped queryset.

get_success_url()[source]

Redirect back to the list view after the action.

get_form_class()[source]

Return form_class or Django’s base Form.