mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
fix(17542) add contact to tunnels
This commit is contained in:
parent
e3c3ca191c
commit
5b2241aaaf
@ -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 CustomFieldsMixin, CustomLinksMixin, TagsMixin, ContactsMixin
|
||||
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.
|
||||
@ -30,7 +30,7 @@ class TunnelGroup(OrganizationalModel):
|
||||
return reverse('vpn:tunnelgroup', args=[self.pk])
|
||||
|
||||
|
||||
class Tunnel(PrimaryModel):
|
||||
class Tunnel(ContactsMixin, PrimaryModel):
|
||||
name = models.CharField(
|
||||
verbose_name=_('name'),
|
||||
max_length=100,
|
||||
|
@ -62,6 +62,9 @@ class TunnelGroupBulkDeleteView(generic.BulkDeleteView):
|
||||
filterset = filtersets.TunnelGroupFilterSet
|
||||
table = tables.TunnelGroupTable
|
||||
|
||||
@register_model_view(Tunnel, 'contacts')
|
||||
class TunnelGroupContactsView(ObjectContactsView):
|
||||
queryset = TunnelGroup.objects.all()
|
||||
|
||||
#
|
||||
# Tunnels
|
||||
@ -121,6 +124,9 @@ class TunnelBulkDeleteView(generic.BulkDeleteView):
|
||||
filterset = filtersets.TunnelFilterSet
|
||||
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