17058 RackType name -> model (#17059)

* 17058 RackType name -> model

* 17058 RackType name -> model

* 17058 fix tests

* 17058 fix tests
This commit is contained in:
Arthur Hanson
2024-08-01 20:06:51 +07:00
committed by GitHub
parent c51e91dddd
commit d6f2fc7d29
15 changed files with 74 additions and 59 deletions

View File

@@ -208,10 +208,13 @@ class RackTypeForm(NetBoxModelForm):
queryset=Manufacturer.objects.all()
)
comments = CommentField()
slug = SlugField()
slug = SlugField(
label=_('Slug'),
slug_source='model'
)
fieldsets = (
FieldSet('manufacturer', 'name', 'slug', 'description', 'form_factor', 'airflow', 'tags', name=_('Rack Type')),
FieldSet('manufacturer', 'model', 'slug', 'description', 'form_factor', 'airflow', 'tags', name=_('Rack Type')),
FieldSet(
'width', 'u_height',
InlineFields('outer_width', 'outer_depth', 'outer_unit', label=_('Outer Dimensions')),
@@ -224,7 +227,7 @@ class RackTypeForm(NetBoxModelForm):
class Meta:
model = RackType
fields = [
'manufacturer', 'name', 'slug', 'form_factor', 'width', 'u_height', 'starting_unit', 'desc_units',
'manufacturer', 'model', 'slug', 'form_factor', 'width', 'u_height', 'starting_unit', 'desc_units',
'outer_width', 'outer_depth', 'outer_unit', 'mounting_depth', 'weight', 'max_weight', 'weight_unit',
'airflow', 'description', 'comments', 'tags',
]