mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 21:02:23 -06:00
Replace custom form templates with TabbedFieldGroups
This commit is contained in:
@@ -7,6 +7,7 @@ from ipam.models import IPAddress, RouteTarget, VLAN
|
||||
from netbox.forms import NetBoxModelForm
|
||||
from tenancy.forms import TenancyForm
|
||||
from utilities.forms.fields import CommentField, DynamicModelChoiceField, DynamicModelMultipleChoiceField, SlugField
|
||||
from utilities.forms.rendering import TabbedFieldGroups
|
||||
from utilities.forms.utils import add_blank_choice, get_field_value
|
||||
from utilities.forms.widgets import HTMXSelect
|
||||
from virtualization.models import VirtualMachine, VMInterface
|
||||
@@ -444,6 +445,18 @@ class L2VPNTerminationForm(NetBoxModelForm):
|
||||
label=_('Interface')
|
||||
)
|
||||
|
||||
fieldsets = (
|
||||
(None, (
|
||||
'l2vpn',
|
||||
TabbedFieldGroups(
|
||||
(_('VLAN'), 'vlan'),
|
||||
(_('Device'), 'interface'),
|
||||
(_('Virtual Machine'), 'vminterface'),
|
||||
),
|
||||
'tags',
|
||||
)),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = L2VPNTermination
|
||||
fields = ('l2vpn', 'tags')
|
||||
|
||||
@@ -479,7 +479,6 @@ class L2VPNTerminationView(generic.ObjectView):
|
||||
class L2VPNTerminationEditView(generic.ObjectEditView):
|
||||
queryset = L2VPNTermination.objects.all()
|
||||
form = forms.L2VPNTerminationForm
|
||||
template_name = 'vpn/l2vpntermination_edit.html'
|
||||
|
||||
|
||||
@register_model_view(L2VPNTermination, 'delete')
|
||||
|
||||
Reference in New Issue
Block a user