Merge pull request #10206 from netbox-community/10178-devicemanufacturer

#10178 add manufacturer to device detail view devicetype
This commit is contained in:
Jeremy Stretch 2022-08-30 08:39:11 -04:00 committed by GitHub
commit 1ba47ae67c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -168,6 +168,10 @@ class DeviceType(NetBoxModel):
def get_absolute_url(self): def get_absolute_url(self):
return reverse('dcim:devicetype', args=[self.pk]) return reverse('dcim:devicetype', args=[self.pk])
@property
def get_full_name(self):
return f"{ self.manufacturer } { self.model }"
def to_yaml(self): def to_yaml(self):
data = { data = {
'manufacturer': self.manufacturer.name, 'manufacturer': self.manufacturer.name,

View File

@ -90,7 +90,7 @@
<tr> <tr>
<th scope="row">Device Type</th> <th scope="row">Device Type</th>
<td> <td>
{{ object.device_type|linkify }} ({{ object.device_type.u_height }}U) {{ object.device_type|linkify:"get_full_name" }} ({{ object.device_type.u_height }}U)
</td> </td>
</tr> </tr>
<tr> <tr>