15
15
from utilities .forms .fields import ColorField , CommentField , DynamicModelChoiceField , DynamicModelMultipleChoiceField
16
16
from utilities .forms .rendering import FieldSet , InlineFields , TabbedGroups
17
17
from utilities .forms .widgets import BulkEditNullBooleanSelect , NumberWithOptions
18
- from wireless .models import WirelessLAN , WirelessLANGroup
18
+ from virtualization .models import Cluster
19
19
from wireless .choices import WirelessRoleChoices
20
+ from wireless .models import WirelessLAN , WirelessLANGroup
20
21
21
22
__all__ = (
22
23
'CableBulkEditForm' ,
@@ -721,6 +722,14 @@ class DeviceBulkEditForm(NetBoxModelBulkEditForm):
721
722
queryset = ConfigTemplate .objects .all (),
722
723
required = False
723
724
)
725
+ cluster = DynamicModelChoiceField (
726
+ label = _ ('Cluster' ),
727
+ queryset = Cluster .objects .all (),
728
+ required = False ,
729
+ query_params = {
730
+ 'site_id' : ['$site' , 'null' ]
731
+ },
732
+ )
724
733
comments = CommentField ()
725
734
726
735
model = Device
@@ -729,9 +738,10 @@ class DeviceBulkEditForm(NetBoxModelBulkEditForm):
729
738
FieldSet ('site' , 'location' , name = _ ('Location' )),
730
739
FieldSet ('manufacturer' , 'device_type' , 'airflow' , 'serial' , name = _ ('Hardware' )),
731
740
FieldSet ('config_template' , name = _ ('Configuration' )),
741
+ FieldSet ('cluster' , name = _ ('Virtualization' )),
732
742
)
733
743
nullable_fields = (
734
- 'location' , 'tenant' , 'platform' , 'serial' , 'airflow' , 'description' , 'comments' ,
744
+ 'location' , 'tenant' , 'platform' , 'serial' , 'airflow' , 'description' , 'cluster' , ' comments' ,
735
745
)
736
746
737
747
0 commit comments