#3087: Add InvetoryItemRole

This commit is contained in:
jeremystretch
2021-12-27 10:18:39 -05:00
parent a2821807f6
commit 08fd357d27
22 changed files with 469 additions and 10 deletions

View File

@@ -37,6 +37,7 @@ __all__ = (
'InterfaceForm',
'InterfaceTemplateForm',
'InventoryItemForm',
'InventoryItemRoleForm',
'LocationForm',
'ManufacturerForm',
'ModuleForm',
@@ -1382,3 +1383,21 @@ class InventoryItemForm(CustomFieldModelForm):
'device', 'parent', 'name', 'label', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description',
'tags',
]
#
# Device component roles
#
class InventoryItemRoleForm(CustomFieldModelForm):
slug = SlugField()
tags = DynamicModelMultipleChoiceField(
queryset=Tag.objects.all(),
required=False
)
class Meta:
model = InventoryItemRole
fields = [
'name', 'slug', 'color', 'description', 'tags',
]