mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #15771: Show id field as supported on all bulk import forms
This commit is contained in:
@ -73,11 +73,6 @@ class NetBoxModelImportForm(CSVModelForm, NetBoxModelForm):
|
|||||||
"""
|
"""
|
||||||
Base form for creating a NetBox objects from CSV data. Used for bulk importing.
|
Base form for creating a NetBox objects from CSV data. Used for bulk importing.
|
||||||
"""
|
"""
|
||||||
id = forms.IntegerField(
|
|
||||||
label=_('Id'),
|
|
||||||
required=False,
|
|
||||||
help_text='Numeric ID of an existing object to update (if not creating a new object)'
|
|
||||||
)
|
|
||||||
tags = CSVModelMultipleChoiceField(
|
tags = CSVModelMultipleChoiceField(
|
||||||
label=_('Tags'),
|
label=_('Tags'),
|
||||||
queryset=Tag.objects.all(),
|
queryset=Tag.objects.all(),
|
||||||
|
@ -70,6 +70,12 @@ class CSVModelForm(forms.ModelForm):
|
|||||||
"""
|
"""
|
||||||
ModelForm used for the import of objects in CSV format.
|
ModelForm used for the import of objects in CSV format.
|
||||||
"""
|
"""
|
||||||
|
id = forms.IntegerField(
|
||||||
|
label=_('ID'),
|
||||||
|
required=False,
|
||||||
|
help_text=_('Numeric ID of an existing object to update (if not creating a new object)')
|
||||||
|
)
|
||||||
|
|
||||||
def __init__(self, *args, headers=None, **kwargs):
|
def __init__(self, *args, headers=None, **kwargs):
|
||||||
self.headers = headers or {}
|
self.headers = headers or {}
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
Reference in New Issue
Block a user