mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 00:15:17 -06:00
ipaddresses bulk import feature added into services bulk import
This commit is contained in:
parent
e4e5d5086c
commit
8db04ab66c
@ -9,7 +9,8 @@ from ipam.constants import *
|
|||||||
from ipam.models import *
|
from ipam.models import *
|
||||||
from netbox.forms import NetBoxModelImportForm
|
from netbox.forms import NetBoxModelImportForm
|
||||||
from tenancy.models import Tenant
|
from tenancy.models import Tenant
|
||||||
from utilities.forms import CSVChoiceField, CSVContentTypeField, CSVModelChoiceField, SlugField
|
from utilities.forms import CSVChoiceField, CSVContentTypeField, CSVModelChoiceField, SlugField, \
|
||||||
|
CSVModelMultipleChoiceField
|
||||||
from virtualization.models import VirtualMachine, VMInterface
|
from virtualization.models import VirtualMachine, VMInterface
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
@ -424,10 +425,17 @@ class ServiceImportForm(NetBoxModelImportForm):
|
|||||||
choices=ServiceProtocolChoices,
|
choices=ServiceProtocolChoices,
|
||||||
help_text=_('IP protocol')
|
help_text=_('IP protocol')
|
||||||
)
|
)
|
||||||
|
ipaddresses = CSVModelMultipleChoiceField(
|
||||||
|
queryset=IPAddress.objects.all(),
|
||||||
|
required=False,
|
||||||
|
to_field_name='address',
|
||||||
|
help_text=_('IP Address'),
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Service
|
model = Service
|
||||||
fields = ('device', 'virtual_machine', 'name', 'protocol', 'ports', 'description', 'comments', 'tags')
|
fields = (
|
||||||
|
'device', 'virtual_machine', 'ipaddresses', 'name', 'protocol', 'ports', 'description', 'comments', 'tags')
|
||||||
|
|
||||||
|
|
||||||
class L2VPNImportForm(NetBoxModelImportForm):
|
class L2VPNImportForm(NetBoxModelImportForm):
|
||||||
|
Loading…
Reference in New Issue
Block a user