Display manufacturer & model of module type on module view

This commit is contained in:
Jeremy Stretch 2024-07-31 14:40:05 -04:00
parent 8d585031d8
commit 2168a73a2d
2 changed files with 5 additions and 1 deletions

View File

@ -417,6 +417,10 @@ class ModuleType(ImageAttachmentsMixin, PrimaryModel, WeightMixin):
def get_absolute_url(self):
return reverse('dcim:moduletype', args=[self.pk])
@property
def full_name(self):
return f"{self.manufacturer} {self.model}"
def to_yaml(self):
data = {
'manufacturer': self.manufacturer.name,

View File

@ -60,7 +60,7 @@
</tr>
<tr>
<th scope="row">{% trans "Module Type" %}</th>
<td>{{ object.module_type|linkify }}</td>
<td>{{ object.module_type|linkify:"full_name" }}</td>
</tr>
<tr>
<th scope="row">{% trans "Status" %}</th>