Skip to main content

ActionForm

This class provides a form structure for performing bulk actions on selected items within an administrative interface. It includes a choice field for selecting the desired action and a hidden boolean field to manage selections across multiple pages of results.

Attributes

AttributeTypeDescription
actionforms.ChoiceFieldChoice field representing the specific administrative action to be performed on the selected items.
select_acrossforms.BooleanField = 0Boolean flag indicating whether the action should apply to all items across all pages of the result set, rather than just the visible items.

Constructor

Signature

def ActionForm() - > null

Signature

def ActionForm(
data: dict = None,
files: dict = None,
auto_id: str = 'id_%s',
prefix: str = None,
initial: dict = None,
error_class: type = ErrorList,
label_suffix: str = None,
empty_permitted: bool = False,
field_order: list = None,
use_required_attribute: bool = None,
renderer: [BaseRenderer](../../../forms/renderers/baserenderer.md?sid=django_forms_renderers_baserenderer) = None
)

Parameters

NameTypeDescription
datadict = NoneA dictionary of form data used for validation and field population
filesdict = NoneA dictionary of uploaded file data
auto_idstr = 'id_%s'The format string used to generate HTML ID attributes for form fields
prefixstr = NoneA string used to prefix every field name in the form's HTML output
initialdict = NoneA dictionary of initial values for the form fields
error_classtype = ErrorListThe class used to display form errors
label_suffixstr = NoneThe character or string to append after every field label
empty_permittedbool = FalseWhether the form is allowed to be empty and still be considered valid
field_orderlist = NoneA list of field names specifying the order in which they should be rendered
use_required_attributebool = NoneWhether to use the HTML 'required' attribute on form inputs
renderer[BaseRenderer](../../../forms/renderers/baserenderer.md?sid=django_forms_renderers_baserenderer) = NoneThe renderer instance used to render the form to HTML