17058 RackType name -> model

This commit is contained in:
Arthur Hanson 2024-08-01 14:35:24 +07:00
parent c2b325974a
commit bcb99cdacd
4 changed files with 13 additions and 6 deletions

View File

@ -10,9 +10,13 @@ A rack type defines the physical characteristics of a particular model of [rack]
The [manufacturer](./manufacturer.md) which produces this type of rack.
### Name
### Model
The unique name of the rack type.
The model number assigned to this rack type by its manufacturer. Must be unique to the manufacturer.
### Slug
A unique URL-friendly representation of the model identifier. (This value can be used for filtering.)
### Form Factor

View File

@ -208,7 +208,10 @@ class RackTypeForm(NetBoxModelForm):
queryset=Manufacturer.objects.all()
)
comments = CommentField()
slug = SlugField()
slug = SlugField(
label=_('Slug'),
slug_source='model'
)
fieldsets = (
FieldSet('manufacturer', 'model', 'slug', 'description', 'form_factor', 'airflow', 'tags', name=_('Rack Type')),

View File

@ -246,7 +246,7 @@ class PowerPortIndex(SearchIndex):
class RackTypeIndex(SearchIndex):
model = models.RackType
fields = (
('name', 100),
('model', 100),
('description', 500),
('comments', 5000),
)

View File

@ -17,8 +17,8 @@
<td>{{ object.manufacturer|linkify }}</td>
</tr>
<tr>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
<th scope="row">{% trans "Model" %}</th>
<td>{{ object.model }}</td>
</tr>
<tr>
<th scope="row">{% trans "Description" %}</th>