Просмотр исходного кода

Changed nat_outside to ManyToManyColumn

atownson 3 лет назад
Родитель
Сommit
63e8faeed9
1 измененных файлов с 2 добавлено и 10 удалено
  1. 2 10
      netbox/ipam/tables/ip.py

+ 2 - 10
netbox/ipam/tables/ip.py

@@ -56,14 +56,6 @@ VRF_LINK = """
 {% endif %}
 """
 
-NAT_OUTSIDE_LINK = """
-{% if record.nat_outside.count > 0 %}
-    {% for nat in record.nat_outside.all %}<a href="{{ nat.get_absolute_url }}">{{ nat.address.ip }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
-{% else %}
-    &mdash;
-{% endif %}
-"""
-
 
 #
 # RIRs
@@ -368,8 +360,8 @@ class IPAddressTable(TenancyColumnsMixin, NetBoxTable):
         orderable=False,
         verbose_name='NAT (Inside)'
     )
-    nat_outside = tables.TemplateColumn(
-        template_code=NAT_OUTSIDE_LINK,
+    nat_outside = tables.ManyToManyColumn(
+        linkify_item=True,
         orderable=False,
         verbose_name='NAT (Outside)'
     )