mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-09 00:58:16 -06:00
12826 remove role
This commit is contained in:
parent
1800e49f65
commit
c8a5197b2c
@ -220,11 +220,6 @@ class RackRoleBulkEditForm(NetBoxModelBulkEditForm):
|
|||||||
|
|
||||||
|
|
||||||
class RackTypeBulkEditForm(NetBoxModelBulkEditForm):
|
class RackTypeBulkEditForm(NetBoxModelBulkEditForm):
|
||||||
role = DynamicModelChoiceField(
|
|
||||||
label=_('Role'),
|
|
||||||
queryset=RackRole.objects.all(),
|
|
||||||
required=False
|
|
||||||
)
|
|
||||||
type = forms.ChoiceField(
|
type = forms.ChoiceField(
|
||||||
label=_('Type'),
|
label=_('Type'),
|
||||||
choices=add_blank_choice(RackTypeChoices),
|
choices=add_blank_choice(RackTypeChoices),
|
||||||
@ -289,7 +284,7 @@ class RackTypeBulkEditForm(NetBoxModelBulkEditForm):
|
|||||||
|
|
||||||
model = Rack
|
model = Rack
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('role', 'description', name=_('Rack')),
|
FieldSet('description', name=_('Rack')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
'type', 'width', 'u_height', 'desc_units', 'outer_width', 'outer_depth', 'outer_unit', 'mounting_depth',
|
'type', 'width', 'u_height', 'desc_units', 'outer_width', 'outer_depth', 'outer_unit', 'mounting_depth',
|
||||||
name=_('Hardware')
|
name=_('Hardware')
|
||||||
|
@ -181,13 +181,6 @@ class RackRoleImportForm(NetBoxModelImportForm):
|
|||||||
|
|
||||||
|
|
||||||
class RackTypeImportForm(NetBoxModelImportForm):
|
class RackTypeImportForm(NetBoxModelImportForm):
|
||||||
role = CSVModelChoiceField(
|
|
||||||
label=_('Role'),
|
|
||||||
queryset=RackRole.objects.all(),
|
|
||||||
required=False,
|
|
||||||
to_field_name='name',
|
|
||||||
help_text=_('Name of assigned role')
|
|
||||||
)
|
|
||||||
type = CSVChoiceField(
|
type = CSVChoiceField(
|
||||||
label=_('Type'),
|
label=_('Type'),
|
||||||
choices=RackTypeChoices,
|
choices=RackTypeChoices,
|
||||||
@ -215,7 +208,7 @@ class RackTypeImportForm(NetBoxModelImportForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = RackType
|
model = RackType
|
||||||
fields = (
|
fields = (
|
||||||
'name', 'role', 'type',
|
'name', 'type',
|
||||||
'width', 'u_height', 'desc_units', 'outer_width', 'outer_depth', 'outer_unit', 'mounting_depth', 'weight',
|
'width', 'u_height', 'desc_units', 'outer_width', 'outer_depth', 'outer_unit', 'mounting_depth', 'weight',
|
||||||
'max_weight', 'weight_unit', 'description', 'comments', 'tags',
|
'max_weight', 'weight_unit', 'description', 'comments', 'tags',
|
||||||
)
|
)
|
||||||
|
@ -203,15 +203,10 @@ class RackRoleForm(NetBoxModelForm):
|
|||||||
|
|
||||||
|
|
||||||
class RackTypeForm(NetBoxModelForm):
|
class RackTypeForm(NetBoxModelForm):
|
||||||
role = DynamicModelChoiceField(
|
|
||||||
label=_('Role'),
|
|
||||||
queryset=RackRole.objects.all(),
|
|
||||||
required=False
|
|
||||||
)
|
|
||||||
comments = CommentField()
|
comments = CommentField()
|
||||||
|
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('name', 'status', 'role', 'description', 'tags', name=_('Rack')),
|
FieldSet('name', 'description', 'tags', name=_('Rack')),
|
||||||
FieldSet(
|
FieldSet(
|
||||||
'type', 'width', 'starting_unit', 'u_height',
|
'type', 'width', 'starting_unit', 'u_height',
|
||||||
InlineFields('outer_width', 'outer_depth', 'outer_unit', label=_('Outer Dimensions')),
|
InlineFields('outer_width', 'outer_depth', 'outer_unit', label=_('Outer Dimensions')),
|
||||||
@ -221,9 +216,9 @@ class RackTypeForm(NetBoxModelForm):
|
|||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Rack
|
model = RackType
|
||||||
fields = [
|
fields = [
|
||||||
'name', 'role',
|
'name',
|
||||||
'type', 'width', 'u_height', 'starting_unit', 'desc_units', 'outer_width', 'outer_depth',
|
'type', 'width', 'u_height', 'starting_unit', 'desc_units', 'outer_width', 'outer_depth',
|
||||||
'outer_unit', 'mounting_depth', 'weight', 'max_weight', 'weight_unit', 'description', 'comments', 'tags',
|
'outer_unit', 'mounting_depth', 'weight', 'max_weight', 'weight_unit', 'description', 'comments', 'tags',
|
||||||
]
|
]
|
||||||
|
@ -64,16 +64,6 @@ class Migration(migrations.Migration):
|
|||||||
('max_weight', models.PositiveIntegerField(blank=True, null=True)),
|
('max_weight', models.PositiveIntegerField(blank=True, null=True)),
|
||||||
('_abs_max_weight', models.PositiveBigIntegerField(blank=True, null=True)),
|
('_abs_max_weight', models.PositiveBigIntegerField(blank=True, null=True)),
|
||||||
('mounting_depth', models.PositiveSmallIntegerField(blank=True, null=True)),
|
('mounting_depth', models.PositiveSmallIntegerField(blank=True, null=True)),
|
||||||
(
|
|
||||||
'role',
|
|
||||||
models.ForeignKey(
|
|
||||||
blank=True,
|
|
||||||
null=True,
|
|
||||||
on_delete=django.db.models.deletion.PROTECT,
|
|
||||||
related_name='racktypes',
|
|
||||||
to='dcim.rackrole',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
|
@ -51,14 +51,6 @@ class RackType(ImageAttachmentsMixin, PrimaryModel, WeightMixin):
|
|||||||
max_length=100,
|
max_length=100,
|
||||||
blank=True
|
blank=True
|
||||||
)
|
)
|
||||||
role = models.ForeignKey(
|
|
||||||
to='dcim.RackRole',
|
|
||||||
on_delete=models.PROTECT,
|
|
||||||
related_name='racktypes',
|
|
||||||
blank=True,
|
|
||||||
null=True,
|
|
||||||
help_text=_('Functional role')
|
|
||||||
)
|
|
||||||
type = models.CharField(
|
type = models.CharField(
|
||||||
choices=RackTypeChoices,
|
choices=RackTypeChoices,
|
||||||
max_length=50,
|
max_length=50,
|
||||||
|
@ -55,9 +55,6 @@ class RackTypeTable(NetBoxTable):
|
|||||||
order_by=('_name',),
|
order_by=('_name',),
|
||||||
linkify=True
|
linkify=True
|
||||||
)
|
)
|
||||||
role = columns.ColoredLabelColumn(
|
|
||||||
verbose_name=_('Role'),
|
|
||||||
)
|
|
||||||
u_height = tables.TemplateColumn(
|
u_height = tables.TemplateColumn(
|
||||||
template_code="{{ value }}U",
|
template_code="{{ value }}U",
|
||||||
verbose_name=_('Height')
|
verbose_name=_('Height')
|
||||||
@ -90,13 +87,13 @@ class RackTypeTable(NetBoxTable):
|
|||||||
class Meta(NetBoxTable.Meta):
|
class Meta(NetBoxTable.Meta):
|
||||||
model = RackType
|
model = RackType
|
||||||
fields = (
|
fields = (
|
||||||
'pk', 'id', 'name', 'role',
|
'pk', 'id', 'name',
|
||||||
'type', 'u_height', 'starting_unit', 'width', 'outer_width', 'outer_depth', 'mounting_depth',
|
'type', 'u_height', 'starting_unit', 'width', 'outer_width', 'outer_depth', 'mounting_depth',
|
||||||
'weight', 'max_weight', 'comments',
|
'weight', 'max_weight', 'comments',
|
||||||
'description', 'tags', 'created', 'last_updated',
|
'description', 'tags', 'created', 'last_updated',
|
||||||
)
|
)
|
||||||
default_columns = (
|
default_columns = (
|
||||||
'pk', 'name', 'role', 'u_height',
|
'pk', 'name', 'u_height',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user