diff --git a/docs/plugins/development/views.md b/docs/plugins/development/views.md index d5d376db8..01c7737ba 100644 --- a/docs/plugins/development/views.md +++ b/docs/plugins/development/views.md @@ -64,6 +64,7 @@ Generic view classes (documented below) facilitate common operations, such as cr | `ObjectListView` | View a list of objects | | `BulkImportView` | Import a set of new objects | | `BulkEditView` | Edit multiple objects | +| `BulkRenameView` | Rename multiple objects | | `BulkDeleteView` | Delete multiple objects | !!! warning @@ -171,6 +172,10 @@ Below are the class definitions for NetBox's multi-object views. These views han options: members: false +::: netbox.views.generic.BulkRenameView + options: + members: false + ::: netbox.views.generic.BulkDeleteView options: members: diff --git a/netbox/netbox/views/generic/bulk_views.py b/netbox/netbox/views/generic/bulk_views.py index 1d8a9cbd4..9872a158c 100644 --- a/netbox/netbox/views/generic/bulk_views.py +++ b/netbox/netbox/views/generic/bulk_views.py @@ -55,8 +55,7 @@ class ObjectListView(BaseMultiObjectView, ActionsMixin, TableMixin): Attributes: filterset: A django-filter FilterSet that is applied to the queryset filterset_form: The form class used to render filter options - actions: A mapping of supported actions to their required permissions. When adding custom actions, bulk - action names must be prefixed with `bulk_`. (See ActionsMixin.) + actions: An iterable of ObjectAction subclasses (see ActionsMixin) """ template_name = 'generic/object_list.html' filterset = None @@ -731,6 +730,9 @@ class BulkEditView(GetReturnURLMixin, BaseMultiObjectView): class BulkRenameView(GetReturnURLMixin, BaseMultiObjectView): """ An extendable view for renaming objects in bulk. + + Attributes: + field_name: The name of the object attribute for which the value is being updated (defaults to "name") """ field_name = 'name' template_name = 'generic/bulk_rename.html' diff --git a/netbox/netbox/views/generic/object_views.py b/netbox/netbox/views/generic/object_views.py index 2e9b73d20..5bc79d962 100644 --- a/netbox/netbox/views/generic/object_views.py +++ b/netbox/netbox/views/generic/object_views.py @@ -47,6 +47,7 @@ class ObjectView(ActionsMixin, BaseObjectView): Attributes: tab: A ViewTab instance for the view + actions: An iterable of ObjectAction subclasses (see ActionsMixin) """ tab = None actions = (CloneObject, EditObject, DeleteObject) @@ -96,8 +97,7 @@ class ObjectChildrenView(ObjectView, ActionsMixin, TableMixin): table: The django-tables2 Table class used to render the child objects list filterset: A django-filter FilterSet that is applied to the queryset filterset_form: The form class used to render filter options - actions: A mapping of supported actions to their required permissions. When adding custom actions, bulk - action names must be prefixed with `bulk_`. (See ActionsMixin.) + actions: An iterable of ObjectAction subclasses (see ActionsMixin) """ child_model = None table = None