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

Introduce the RouteTarget model

This commit is contained in:
Jeremy Stretch
2020-09-24 11:25:52 -04:00
parent 9b16d6df2e
commit dfb5a06d9d
14 changed files with 397 additions and 12 deletions

View File

@@ -5,7 +5,7 @@ from dcim.models import Interface
from tenancy.tables import COL_TENANT
from utilities.tables import BaseTable, BooleanColumn, ButtonsColumn, TagColumn, ToggleColumn
from virtualization.models import VMInterface
from .models import Aggregate, IPAddress, Prefix, RIR, Role, Service, VLAN, VLANGroup, VRF
from .models import Aggregate, IPAddress, Prefix, RIR, Role, RouteTarget, Service, VLAN, VLANGroup, VRF
RIR_UTILIZATION = """
<div class="progress">
@@ -176,6 +176,26 @@ class VRFTable(BaseTable):
default_columns = ('pk', 'name', 'rd', 'tenant', 'description')
#
# Route targets
#
class RouteTargetTable(BaseTable):
pk = ToggleColumn()
name = tables.LinkColumn()
tenant = tables.TemplateColumn(
template_code=COL_TENANT
)
tags = TagColumn(
url_name='ipam:vrf_list'
)
class Meta(BaseTable.Meta):
model = RouteTarget
fields = ('pk', 'name', 'tenant', 'description', 'tags')
default_columns = ('pk', 'name', 'tenant', 'description')
#
# RIRs
#