mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-25 06:37:46 -06:00
Adds contact tabs (#12460)
* adds contact tabs #11599 * fixed lint issues * changes as per review * changes as per review * replaces generic object template with base template
This commit is contained in:
committed by
GitHub
parent
e71a98499f
commit
4eb5e90ccc
@@ -20,6 +20,7 @@ from extras.views import ObjectConfigContextView
|
||||
from ipam.models import ASN, IPAddress, Prefix, VLAN, VLANGroup
|
||||
from ipam.tables import InterfaceVLANTable
|
||||
from netbox.views import generic
|
||||
from tenancy.views import ObjectContactsView
|
||||
from utilities.forms import ConfirmationForm
|
||||
from utilities.paginator import EnhancedPaginator, get_paginate_count
|
||||
from utilities.permissions import get_permission_for_model
|
||||
@@ -267,6 +268,11 @@ class RegionBulkDeleteView(generic.BulkDeleteView):
|
||||
table = tables.RegionTable
|
||||
|
||||
|
||||
@register_model_view(Region, 'contacts')
|
||||
class RegionContactsView(ObjectContactsView):
|
||||
queryset = Region.objects.all()
|
||||
|
||||
|
||||
#
|
||||
# Site groups
|
||||
#
|
||||
@@ -342,6 +348,11 @@ class SiteGroupBulkDeleteView(generic.BulkDeleteView):
|
||||
table = tables.SiteGroupTable
|
||||
|
||||
|
||||
@register_model_view(SiteGroup, 'contacts')
|
||||
class SiteGroupContactsView(ObjectContactsView):
|
||||
queryset = SiteGroup.objects.all()
|
||||
|
||||
|
||||
#
|
||||
# Sites
|
||||
#
|
||||
@@ -435,6 +446,11 @@ class SiteBulkDeleteView(generic.BulkDeleteView):
|
||||
table = tables.SiteTable
|
||||
|
||||
|
||||
@register_model_view(Site, 'contacts')
|
||||
class SiteContactsView(ObjectContactsView):
|
||||
queryset = Site.objects.all()
|
||||
|
||||
|
||||
#
|
||||
# Locations
|
||||
#
|
||||
@@ -523,6 +539,11 @@ class LocationBulkDeleteView(generic.BulkDeleteView):
|
||||
table = tables.LocationTable
|
||||
|
||||
|
||||
@register_model_view(Location, 'contacts')
|
||||
class LocationContactsView(ObjectContactsView):
|
||||
queryset = Location.objects.all()
|
||||
|
||||
|
||||
#
|
||||
# Rack roles
|
||||
#
|
||||
@@ -740,6 +761,11 @@ class RackBulkDeleteView(generic.BulkDeleteView):
|
||||
table = tables.RackTable
|
||||
|
||||
|
||||
@register_model_view(Rack, 'contacts')
|
||||
class RackContactsView(ObjectContactsView):
|
||||
queryset = Rack.objects.all()
|
||||
|
||||
|
||||
#
|
||||
# Rack reservations
|
||||
#
|
||||
@@ -874,6 +900,11 @@ class ManufacturerBulkDeleteView(generic.BulkDeleteView):
|
||||
table = tables.ManufacturerTable
|
||||
|
||||
|
||||
@register_model_view(Manufacturer, 'contacts')
|
||||
class ManufacturerContactsView(ObjectContactsView):
|
||||
queryset = Manufacturer.objects.all()
|
||||
|
||||
|
||||
#
|
||||
# Device types
|
||||
#
|
||||
@@ -2088,6 +2119,11 @@ class DeviceBulkRenameView(generic.BulkRenameView):
|
||||
table = tables.DeviceTable
|
||||
|
||||
|
||||
@register_model_view(Device, 'contacts')
|
||||
class DeviceContactsView(ObjectContactsView):
|
||||
queryset = Device.objects.all()
|
||||
|
||||
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
@@ -3469,6 +3505,11 @@ class PowerPanelBulkDeleteView(generic.BulkDeleteView):
|
||||
table = tables.PowerPanelTable
|
||||
|
||||
|
||||
@register_model_view(PowerPanel, 'contacts')
|
||||
class PowerPanelContactsView(ObjectContactsView):
|
||||
queryset = PowerPanel.objects.all()
|
||||
|
||||
|
||||
#
|
||||
# Power feeds
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user