Просмотр исходного кода

feat(ipam): Add ContactsColumnMixin to ServiceTable

Enhance `ServiceTable` by incorporating `ContactsColumnMixin` for better
contact management. Updates the fields to include `contacts`.

Fixes #20567
Martin Hauser 3 месяцев назад
Родитель
Сommit
a4868f894d
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      netbox/ipam/tables/services.py

+ 4 - 3
netbox/ipam/tables/services.py

@@ -3,6 +3,7 @@ import django_tables2 as tables
 
 from ipam.models import *
 from netbox.tables import NetBoxTable, columns
+from tenancy.tables import ContactsColumnMixin
 
 __all__ = (
     'ServiceTable',
@@ -35,7 +36,7 @@ class ServiceTemplateTable(NetBoxTable):
         default_columns = ('pk', 'name', 'protocol', 'ports', 'description')
 
 
-class ServiceTable(NetBoxTable):
+class ServiceTable(ContactsColumnMixin, NetBoxTable):
     name = tables.Column(
         verbose_name=_('Name'),
         linkify=True
@@ -60,7 +61,7 @@ class ServiceTable(NetBoxTable):
     class Meta(NetBoxTable.Meta):
         model = Service
         fields = (
-            'pk', 'id', 'name', 'parent', 'protocol', 'ports', 'ipaddresses', 'description', 'comments', 'tags',
-            'created', 'last_updated',
+            'pk', 'id', 'name', 'parent', 'protocol', 'ports', 'ipaddresses', 'description', 'contacts', 'comments',
+            'tags', 'created', 'last_updated',
         )
         default_columns = ('pk', 'name', 'parent', 'protocol', 'ports', 'description')