mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 03:46:25 -06:00
fixes 17465 add racktype on bulkimport and bulkedit of racks
This commit is contained in:
parent
9ccbb08e29
commit
538199a8b3
@ -359,6 +359,11 @@ class RackBulkEditForm(NetBoxModelBulkEditForm):
|
|||||||
queryset=RackRole.objects.all(),
|
queryset=RackRole.objects.all(),
|
||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
|
rack_type = DynamicModelChoiceField(
|
||||||
|
label=_('Rack type'),
|
||||||
|
queryset=RackType.objects.all(),
|
||||||
|
required=False,
|
||||||
|
)
|
||||||
serial = forms.CharField(
|
serial = forms.CharField(
|
||||||
max_length=50,
|
max_length=50,
|
||||||
required=False,
|
required=False,
|
||||||
@ -438,7 +443,7 @@ class RackBulkEditForm(NetBoxModelBulkEditForm):
|
|||||||
|
|
||||||
model = Rack
|
model = Rack
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('status', 'role', 'tenant', 'serial', 'asset_tag', 'description', name=_('Rack')),
|
FieldSet('status', 'role', 'tenant', 'serial', 'asset_tag', 'rack_type', 'description', name=_('Rack')),
|
||||||
FieldSet('region', 'site_group', 'site', 'location', name=_('Location')),
|
FieldSet('region', 'site_group', 'site', 'location', name=_('Location')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
'form_factor', 'width', 'u_height', 'desc_units', 'airflow', 'outer_width', 'outer_depth', 'outer_unit',
|
'form_factor', 'width', 'u_height', 'desc_units', 'airflow', 'outer_width', 'outer_depth', 'outer_unit',
|
||||||
|
@ -256,6 +256,13 @@ class RackImportForm(NetBoxModelImportForm):
|
|||||||
to_field_name='name',
|
to_field_name='name',
|
||||||
help_text=_('Name of assigned role')
|
help_text=_('Name of assigned role')
|
||||||
)
|
)
|
||||||
|
rack_type = CSVModelChoiceField(
|
||||||
|
label=_('Rack type'),
|
||||||
|
queryset=RackType.objects.all(),
|
||||||
|
to_field_name='model',
|
||||||
|
required=False,
|
||||||
|
help_text=_('Rack type model')
|
||||||
|
)
|
||||||
form_factor = CSVChoiceField(
|
form_factor = CSVChoiceField(
|
||||||
label=_('Type'),
|
label=_('Type'),
|
||||||
choices=RackFormFactorChoices,
|
choices=RackFormFactorChoices,
|
||||||
@ -289,9 +296,9 @@ class RackImportForm(NetBoxModelImportForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Rack
|
model = Rack
|
||||||
fields = (
|
fields = (
|
||||||
'site', 'location', 'name', 'facility_id', 'tenant', 'status', 'role', 'form_factor', 'serial', 'asset_tag',
|
'site', 'location', 'name', 'facility_id', 'tenant', 'status', 'role', 'rack_type', 'form_factor', 'serial',
|
||||||
'width', 'u_height', 'desc_units', 'outer_width', 'outer_depth', 'outer_unit', 'mounting_depth', 'airflow',
|
'asset_tag', 'width', 'u_height', 'desc_units', 'outer_width', 'outer_depth', 'outer_unit', 'mounting_depth',
|
||||||
'weight', 'max_weight', 'weight_unit', 'description', 'comments', 'tags',
|
'airflow', 'weight', 'max_weight', 'weight_unit', 'description', 'comments', 'tags',
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, data=None, *args, **kwargs):
|
def __init__(self, data=None, *args, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user