Allow custom fields for interfaces. Switch to get_status_display on INTERFACE_ENABLED template code.

This commit is contained in:
Joseph Kennedy 2017-08-28 01:32:38 -04:00
parent f855733f46
commit 271c771b76
2 changed files with 2 additions and 2 deletions

View File

@ -1146,7 +1146,7 @@ class Interface(models.Model):
help_text="This interface is used only for out-of-band management"
)
description = models.CharField(max_length=100, blank=True)
custom_field_values = GenericRelation(CustomFieldValue, content_type_field='obj_type', object_id_field='obj_id')
objects = InterfaceQuerySet.as_manager()
csv_headers = ['device','lag','name','mac_address','form_factor','enabled','description','mtu','mgmt_only','is_virtual','is_wireless','is_connected','is_lag']

View File

@ -104,7 +104,7 @@ DEVICE_STATUS = """
"""
INTERFACE_ENABLED = """
<span class="label label-{{ record.get_status_class }}">{{ record.enabled }}</span>
<span class="label label-{{ record.get_status_class }}">{{ record.get_status_display }}</span>
"""
DEVICE_PRIMARY_IP = """