|
@@ -1,8 +1,9 @@
|
|
|
import django_tables2 as tables
|
|
import django_tables2 as tables
|
|
|
-
|
|
|
|
|
from dcim.models import Location, Region, Site, SiteGroup
|
|
from dcim.models import Location, Region, Site, SiteGroup
|
|
|
|
|
+from tenancy.tables import ContactsColumnMixin, TenancyColumnsMixin
|
|
|
|
|
+
|
|
|
from netbox.tables import NetBoxTable, columns
|
|
from netbox.tables import NetBoxTable, columns
|
|
|
-from tenancy.tables import TenancyColumnsMixin
|
|
|
|
|
|
|
+
|
|
|
from .template_code import LOCATION_BUTTONS
|
|
from .template_code import LOCATION_BUTTONS
|
|
|
|
|
|
|
|
__all__ = (
|
|
__all__ = (
|
|
@@ -17,7 +18,7 @@ __all__ = (
|
|
|
# Regions
|
|
# Regions
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-class RegionTable(NetBoxTable):
|
|
|
|
|
|
|
+class RegionTable(ContactsColumnMixin, NetBoxTable):
|
|
|
name = columns.MPTTColumn(
|
|
name = columns.MPTTColumn(
|
|
|
linkify=True
|
|
linkify=True
|
|
|
)
|
|
)
|
|
@@ -26,9 +27,6 @@ class RegionTable(NetBoxTable):
|
|
|
url_params={'region_id': 'pk'},
|
|
url_params={'region_id': 'pk'},
|
|
|
verbose_name='Sites'
|
|
verbose_name='Sites'
|
|
|
)
|
|
)
|
|
|
- contacts = columns.ManyToManyColumn(
|
|
|
|
|
- linkify_item=True
|
|
|
|
|
- )
|
|
|
|
|
tags = columns.TagColumn(
|
|
tags = columns.TagColumn(
|
|
|
url_name='dcim:region_list'
|
|
url_name='dcim:region_list'
|
|
|
)
|
|
)
|
|
@@ -46,7 +44,7 @@ class RegionTable(NetBoxTable):
|
|
|
# Site groups
|
|
# Site groups
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-class SiteGroupTable(NetBoxTable):
|
|
|
|
|
|
|
+class SiteGroupTable(ContactsColumnMixin, NetBoxTable):
|
|
|
name = columns.MPTTColumn(
|
|
name = columns.MPTTColumn(
|
|
|
linkify=True
|
|
linkify=True
|
|
|
)
|
|
)
|
|
@@ -55,9 +53,6 @@ class SiteGroupTable(NetBoxTable):
|
|
|
url_params={'group_id': 'pk'},
|
|
url_params={'group_id': 'pk'},
|
|
|
verbose_name='Sites'
|
|
verbose_name='Sites'
|
|
|
)
|
|
)
|
|
|
- contacts = columns.ManyToManyColumn(
|
|
|
|
|
- linkify_item=True
|
|
|
|
|
- )
|
|
|
|
|
tags = columns.TagColumn(
|
|
tags = columns.TagColumn(
|
|
|
url_name='dcim:sitegroup_list'
|
|
url_name='dcim:sitegroup_list'
|
|
|
)
|
|
)
|
|
@@ -75,7 +70,7 @@ class SiteGroupTable(NetBoxTable):
|
|
|
# Sites
|
|
# Sites
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-class SiteTable(TenancyColumnsMixin, NetBoxTable):
|
|
|
|
|
|
|
+class SiteTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable):
|
|
|
name = tables.Column(
|
|
name = tables.Column(
|
|
|
linkify=True
|
|
linkify=True
|
|
|
)
|
|
)
|
|
@@ -97,9 +92,6 @@ class SiteTable(TenancyColumnsMixin, NetBoxTable):
|
|
|
verbose_name='ASN Count'
|
|
verbose_name='ASN Count'
|
|
|
)
|
|
)
|
|
|
comments = columns.MarkdownColumn()
|
|
comments = columns.MarkdownColumn()
|
|
|
- contacts = columns.ManyToManyColumn(
|
|
|
|
|
- linkify_item=True
|
|
|
|
|
- )
|
|
|
|
|
tags = columns.TagColumn(
|
|
tags = columns.TagColumn(
|
|
|
url_name='dcim:site_list'
|
|
url_name='dcim:site_list'
|
|
|
)
|
|
)
|
|
@@ -118,7 +110,7 @@ class SiteTable(TenancyColumnsMixin, NetBoxTable):
|
|
|
# Locations
|
|
# Locations
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-class LocationTable(TenancyColumnsMixin, NetBoxTable):
|
|
|
|
|
|
|
+class LocationTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable):
|
|
|
name = columns.MPTTColumn(
|
|
name = columns.MPTTColumn(
|
|
|
linkify=True
|
|
linkify=True
|
|
|
)
|
|
)
|
|
@@ -136,9 +128,6 @@ class LocationTable(TenancyColumnsMixin, NetBoxTable):
|
|
|
url_params={'location_id': 'pk'},
|
|
url_params={'location_id': 'pk'},
|
|
|
verbose_name='Devices'
|
|
verbose_name='Devices'
|
|
|
)
|
|
)
|
|
|
- contacts = columns.ManyToManyColumn(
|
|
|
|
|
- linkify_item=True
|
|
|
|
|
- )
|
|
|
|
|
tags = columns.TagColumn(
|
|
tags = columns.TagColumn(
|
|
|
url_name='dcim:location_list'
|
|
url_name='dcim:location_list'
|
|
|
)
|
|
)
|