mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
14810 add contacts to service
This commit is contained in:
parent
360f3bc01b
commit
0bfb9777be
@ -8,6 +8,7 @@ from django.utils.translation import gettext_lazy as _
|
||||
from ipam.choices import *
|
||||
from ipam.constants import *
|
||||
from netbox.models import PrimaryModel
|
||||
from netbox.models.features import ContactsMixin
|
||||
from utilities.data import array_to_string
|
||||
|
||||
__all__ = (
|
||||
@ -62,7 +63,7 @@ class ServiceTemplate(ServiceBase, PrimaryModel):
|
||||
return reverse('ipam:servicetemplate', args=[self.pk])
|
||||
|
||||
|
||||
class Service(ServiceBase, PrimaryModel):
|
||||
class Service(ContactsMixin, ServiceBase, PrimaryModel):
|
||||
"""
|
||||
A Service represents a layer-four service (e.g. HTTP or SSH) running on a Device or VirtualMachine. A Service may
|
||||
optionally be tied to one or more specific IPAddresses belonging to its parent.
|
||||
|
@ -1280,3 +1280,8 @@ class ServiceBulkDeleteView(generic.BulkDeleteView):
|
||||
queryset = Service.objects.prefetch_related('device', 'virtual_machine')
|
||||
filterset = filtersets.ServiceFilterSet
|
||||
table = tables.ServiceTable
|
||||
|
||||
|
||||
@register_model_view(Service, 'contacts')
|
||||
class ServiceContactsView(ObjectContactsView):
|
||||
queryset = Service.objects.all()
|
||||
|
Loading…
Reference in New Issue
Block a user