mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-25 08:46:10 -06:00
12589 objectpermission bulk edit
This commit is contained in:
parent
93ba0c0177
commit
c4131af496
@ -9,7 +9,6 @@ from utilities.forms import BootstrapMixin
|
||||
from utilities.forms.widgets import DatePicker, NumberWithOptions
|
||||
|
||||
__all__ = (
|
||||
'GroupBulkEditForm',
|
||||
'ObjectPermissionBulkEditForm',
|
||||
'UserBulkEditForm',
|
||||
)
|
||||
@ -52,34 +51,25 @@ class UserBulkEditForm(BootstrapMixin, forms.Form):
|
||||
self.fields['pk'].queryset = self.model.objects.all()
|
||||
|
||||
|
||||
class GroupBulkEditForm(BootstrapMixin, forms.Form):
|
||||
class ObjectPermissionBulkEditForm(BootstrapMixin, forms.Form):
|
||||
pk = forms.ModelMultipleChoiceField(
|
||||
queryset=None, # Set from self.model on init
|
||||
widget=forms.MultipleHiddenInput
|
||||
)
|
||||
first_name = forms.CharField(
|
||||
max_length=150,
|
||||
description = forms.CharField(
|
||||
max_length=200,
|
||||
required=False
|
||||
)
|
||||
enabled = forms.BooleanField(
|
||||
required=False,
|
||||
)
|
||||
|
||||
model = NetBoxGroup
|
||||
model = ObjectPermission
|
||||
fieldsets = (
|
||||
(None, ('asns', 'description')),
|
||||
)
|
||||
nullable_fields = (
|
||||
'asns', 'description', 'comments',
|
||||
(None, ('description', 'enabled')),
|
||||
)
|
||||
nullable_fields = ()
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields['pk'].queryset = self.model.objects.all()
|
||||
|
||||
|
||||
class ObjectPermissionBulkEditForm(NetBoxModelBulkEditForm):
|
||||
model = ObjectPermission
|
||||
fieldsets = (
|
||||
(None, ('description')),
|
||||
)
|
||||
nullable_fields = (
|
||||
'description',
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user