mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-23 09:18:49 +02:00
Closes #19740: Enable recursive nesting for platforms
This commit is contained in:
@@ -504,6 +504,16 @@ class DeviceRoleImportForm(NetBoxModelImportForm):
|
||||
|
||||
class PlatformImportForm(NetBoxModelImportForm):
|
||||
slug = SlugField()
|
||||
parent = CSVModelChoiceField(
|
||||
label=_('Parent'),
|
||||
queryset=Platform.objects.all(),
|
||||
required=False,
|
||||
to_field_name='name',
|
||||
help_text=_('Parent platform'),
|
||||
error_messages={
|
||||
'invalid_choice': _('Platform not found.'),
|
||||
}
|
||||
)
|
||||
manufacturer = CSVModelChoiceField(
|
||||
label=_('Manufacturer'),
|
||||
queryset=Manufacturer.objects.all(),
|
||||
@@ -522,7 +532,7 @@ class PlatformImportForm(NetBoxModelImportForm):
|
||||
class Meta:
|
||||
model = Platform
|
||||
fields = (
|
||||
'name', 'slug', 'manufacturer', 'config_template', 'description', 'tags',
|
||||
'name', 'slug', 'parent', 'manufacturer', 'config_template', 'description', 'tags',
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user