mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-17 04:32:51 -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 django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from netbox.models import ChangeLoggedModel, OrganizationalModel, PrimaryModel
|
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 *
|
from vpn.choices import *
|
||||||
|
|
||||||
__all__ = (
|
__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,
|
An administrative grouping of Tunnels. This can be used to correlate peer-to-peer tunnels which form a mesh,
|
||||||
for example.
|
for example.
|
||||||
@ -27,7 +27,7 @@ class TunnelGroup(OrganizationalModel):
|
|||||||
verbose_name_plural = _('tunnel groups')
|
verbose_name_plural = _('tunnel groups')
|
||||||
|
|
||||||
|
|
||||||
class Tunnel(PrimaryModel):
|
class Tunnel(ContactsMixin, PrimaryModel):
|
||||||
name = models.CharField(
|
name = models.CharField(
|
||||||
verbose_name=_('name'),
|
verbose_name=_('name'),
|
||||||
max_length=100,
|
max_length=100,
|
||||||
|
@ -68,6 +68,11 @@ class TunnelGroupBulkDeleteView(generic.BulkDeleteView):
|
|||||||
table = tables.TunnelGroupTable
|
table = tables.TunnelGroupTable
|
||||||
|
|
||||||
|
|
||||||
|
@register_model_view(TunnelGroup, 'contacts')
|
||||||
|
class TunnelGroupContactsView(ObjectContactsView):
|
||||||
|
queryset = TunnelGroup.objects.all()
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Tunnels
|
# Tunnels
|
||||||
#
|
#
|
||||||
@ -132,6 +137,11 @@ class TunnelBulkDeleteView(generic.BulkDeleteView):
|
|||||||
table = tables.TunnelTable
|
table = tables.TunnelTable
|
||||||
|
|
||||||
|
|
||||||
|
@register_model_view(Tunnel, 'contacts')
|
||||||
|
class TunnelContactsView(ObjectContactsView):
|
||||||
|
queryset = Tunnel.objects.all()
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Tunnel terminations
|
# Tunnel terminations
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user