mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
Add the label
to the string representation
This commit is contained in:
parent
e9f8640ee6
commit
f8851121ab
@ -282,6 +282,8 @@ class InterfaceTemplate(ComponentTemplateModel):
|
|||||||
unique_together = ('device_type', 'name')
|
unique_together = ('device_type', 'name')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
if self.label:
|
||||||
|
return f"{self.name} ({self.label})"
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def instantiate(self, device):
|
def instantiate(self, device):
|
||||||
|
@ -691,6 +691,8 @@ class Interface(CableTermination, ComponentModel):
|
|||||||
unique_together = ('device', 'name')
|
unique_together = ('device', 'name')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
if self.label:
|
||||||
|
return f"{self.name} ({self.label})"
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user