mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
#7844: Allow installing modules via UI without replicating components
This commit is contained in:
@@ -8,6 +8,7 @@ from utilities.forms import (
|
||||
)
|
||||
|
||||
__all__ = (
|
||||
'ComponentTemplateCreateForm',
|
||||
'DeviceComponentCreateForm',
|
||||
'DeviceTypeComponentCreateForm',
|
||||
'FrontPortCreateForm',
|
||||
@@ -51,6 +52,18 @@ class DeviceTypeComponentCreateForm(ComponentCreateForm):
|
||||
field_order = ('device_type', 'name_pattern', 'label_pattern')
|
||||
|
||||
|
||||
class ComponentTemplateCreateForm(ComponentCreateForm):
|
||||
device_type = DynamicModelChoiceField(
|
||||
queryset=DeviceType.objects.all(),
|
||||
required=False
|
||||
)
|
||||
module_type = DynamicModelChoiceField(
|
||||
queryset=ModuleType.objects.all(),
|
||||
required=False
|
||||
)
|
||||
field_order = ('device_type', 'module_type', 'name_pattern', 'label_pattern')
|
||||
|
||||
|
||||
class DeviceComponentCreateForm(ComponentCreateForm):
|
||||
device = DynamicModelChoiceField(
|
||||
queryset=Device.objects.all()
|
||||
|
Reference in New Issue
Block a user