1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Split out NetBoxTable from BaseTable

This commit is contained in:
jeremystretch
2022-01-27 15:48:05 -05:00
parent 4a1b4e0485
commit 59d3f5c4ea
20 changed files with 218 additions and 254 deletions

View File

@@ -1,7 +1,7 @@
import django_tables2 as tables
from ipam.models import *
from netbox.tables import BaseTable, columns
from netbox.tables import NetBoxTable, columns
__all__ = (
'ServiceTable',
@@ -9,8 +9,7 @@ __all__ = (
)
class ServiceTemplateTable(BaseTable):
pk = columns.ToggleColumn()
class ServiceTemplateTable(NetBoxTable):
name = tables.Column(
linkify=True
)
@@ -21,14 +20,13 @@ class ServiceTemplateTable(BaseTable):
url_name='ipam:servicetemplate_list'
)
class Meta(BaseTable.Meta):
class Meta(NetBoxTable.Meta):
model = ServiceTemplate
fields = ('pk', 'id', 'name', 'protocol', 'ports', 'description', 'tags')
default_columns = ('pk', 'name', 'protocol', 'ports', 'description')
class ServiceTable(BaseTable):
pk = columns.ToggleColumn()
class ServiceTable(NetBoxTable):
name = tables.Column(
linkify=True
)
@@ -43,7 +41,7 @@ class ServiceTable(BaseTable):
url_name='ipam:service_list'
)
class Meta(BaseTable.Meta):
class Meta(NetBoxTable.Meta):
model = Service
fields = (
'pk', 'id', 'name', 'parent', 'protocol', 'ports', 'ipaddresses', 'description', 'tags', 'created',