mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Closes #5143: Include a device's asset tag in its display value
This commit is contained in:
parent
a000ded350
commit
9a45547cda
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
### Enhancements
|
### Enhancements
|
||||||
|
|
||||||
|
* [#5143](https://github.com/netbox-community/netbox/issues/5143) - Include a device's asset tag in its display value
|
||||||
* [#7619](https://github.com/netbox-community/netbox/issues/7619) - Permit custom validation rules to be defined as plain data or dotted path to class
|
* [#7619](https://github.com/netbox-community/netbox/issues/7619) - Permit custom validation rules to be defined as plain data or dotted path to class
|
||||||
* [#7761](https://github.com/netbox-community/netbox/issues/7761) - Extend cable tracing across bridged interfaces
|
* [#7761](https://github.com/netbox-community/netbox/issues/7761) - Extend cable tracing across bridged interfaces
|
||||||
* [#7769](https://github.com/netbox-community/netbox/issues/7769) - Enable assignment of IP addresses to an existing FHRP group
|
* [#7769](https://github.com/netbox-community/netbox/issues/7769) - Enable assignment of IP addresses to an existing FHRP group
|
||||||
@ -25,6 +26,8 @@
|
|||||||
|
|
||||||
### REST API Changes
|
### REST API Changes
|
||||||
|
|
||||||
|
* dcim.Device
|
||||||
|
* The `display` field now includes the device's asset tag, if set
|
||||||
* extras.ImageAttachment
|
* extras.ImageAttachment
|
||||||
* Added the `last_updated` field
|
* Added the `last_updated` field
|
||||||
|
|
||||||
|
@ -604,7 +604,9 @@ class Device(PrimaryModel, ConfigContextModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.name:
|
if self.name and self.asset_tag:
|
||||||
|
return f'{self.name} ({self.asset_tag})'
|
||||||
|
elif self.name:
|
||||||
return self.name
|
return self.name
|
||||||
elif self.virtual_chassis:
|
elif self.virtual_chassis:
|
||||||
return f'{self.virtual_chassis.name}:{self.vc_position} ({self.pk})'
|
return f'{self.virtual_chassis.name}:{self.vc_position} ({self.pk})'
|
||||||
|
Loading…
Reference in New Issue
Block a user