From 700aa1ad5c0d3798dfb6d65b86a3895e7320ba1f Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 2 Nov 2020 14:55:05 -0500 Subject: [PATCH] Add import/export RTs to VRFTable --- netbox/ipam/tables.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/netbox/ipam/tables.py b/netbox/ipam/tables.py index bbca3f082..131fa4c76 100644 --- a/netbox/ipam/tables.py +++ b/netbox/ipam/tables.py @@ -59,6 +59,14 @@ VRF_LINK = """ {% endif %} """ +VRF_TARGETS = """ +{% for rt in value.all %} + {{ rt }}{% if not forloop.last %}
{% endif %} +{% empty %} + — +{% endfor %} +""" + VLAN_LINK = """ {% if record.pk %} {{ record.vid }} @@ -130,13 +138,23 @@ class VRFTable(BaseTable): enforce_unique = BooleanColumn( verbose_name='Unique' ) + import_targets = tables.TemplateColumn( + template_code=VRF_TARGETS, + orderable=False + ) + export_targets = tables.TemplateColumn( + template_code=VRF_TARGETS, + orderable=False + ) tags = TagColumn( url_name='ipam:vrf_list' ) class Meta(BaseTable.Meta): model = VRF - fields = ('pk', 'name', 'rd', 'tenant', 'enforce_unique', 'description', 'tags') + fields = ( + 'pk', 'name', 'rd', 'tenant', 'enforce_unique', 'description', 'import_targets', 'export_targets', 'tags', + ) default_columns = ('pk', 'name', 'rd', 'tenant', 'description')