mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 12:12:53 -06:00
Merge pull request #18491 from antoinekh/17542-Contact_Assignment_to_vpn_tunnels
#17542 contact assignment to vpn tunnels
This commit is contained in:
commit
a8b4024016
@ -6,7 +6,7 @@ from django.urls import reverse
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from netbox.models import ChangeLoggedModel, OrganizationalModel, PrimaryModel
|
||||
from netbox.models.features import CustomFieldsMixin, CustomLinksMixin, TagsMixin
|
||||
from netbox.models.features import ContactsMixin, CustomFieldsMixin, CustomLinksMixin, TagsMixin
|
||||
from vpn.choices import *
|
||||
|
||||
__all__ = (
|
||||
@ -16,7 +16,7 @@ __all__ = (
|
||||
)
|
||||
|
||||
|
||||
class TunnelGroup(OrganizationalModel):
|
||||
class TunnelGroup(ContactsMixin, OrganizationalModel):
|
||||
"""
|
||||
An administrative grouping of Tunnels. This can be used to correlate peer-to-peer tunnels which form a mesh,
|
||||
for example.
|
||||
@ -27,7 +27,7 @@ class TunnelGroup(OrganizationalModel):
|
||||
verbose_name_plural = _('tunnel groups')
|
||||
|
||||
|
||||
class Tunnel(PrimaryModel):
|
||||
class Tunnel(ContactsMixin, PrimaryModel):
|
||||
name = models.CharField(
|
||||
verbose_name=_('name'),
|
||||
max_length=100,
|
||||
|
@ -68,6 +68,11 @@ class TunnelGroupBulkDeleteView(generic.BulkDeleteView):
|
||||
table = tables.TunnelGroupTable
|
||||
|
||||
|
||||
@register_model_view(TunnelGroup, 'contacts')
|
||||
class TunnelGroupContactsView(ObjectContactsView):
|
||||
queryset = TunnelGroup.objects.all()
|
||||
|
||||
|
||||
#
|
||||
# Tunnels
|
||||
#
|
||||
@ -132,6 +137,11 @@ class TunnelBulkDeleteView(generic.BulkDeleteView):
|
||||
table = tables.TunnelTable
|
||||
|
||||
|
||||
@register_model_view(Tunnel, 'contacts')
|
||||
class TunnelContactsView(ObjectContactsView):
|
||||
queryset = Tunnel.objects.all()
|
||||
|
||||
|
||||
#
|
||||
# Tunnel terminations
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user