diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 16b9df5b..89ddc846 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -474,6 +474,13 @@ class Device(Thing): key=attrgetter('type')) # last test of each type return self._warning_actions(current_tests) + @property + def verbose_name(self): + type = self.type or '' + manufacturer = self.manufacturer or '' + model = self.model or '' + return f'{type} {manufacturer} {model}' + @declared_attr def __mapper_args__(cls): """Defines inheritance. diff --git a/ereuse_devicehub/templates/inventory/device_list.html b/ereuse_devicehub/templates/inventory/device_list.html index 3cf54939..80384cb1 100644 --- a/ereuse_devicehub/templates/inventory/device_list.html +++ b/ereuse_devicehub/templates/inventory/device_list.html @@ -316,7 +316,7 @@ - {{ dev.type }} {{ dev.manufacturer|d('', true) }} {{ dev.model|d('', true) }} + {{ dev.verbose_name }} diff --git a/ereuse_devicehub/templates/inventory/tag_detail.html b/ereuse_devicehub/templates/inventory/tag_detail.html index 356220d5..3e63ff50 100644 --- a/ereuse_devicehub/templates/inventory/tag_detail.html +++ b/ereuse_devicehub/templates/inventory/tag_detail.html @@ -34,7 +34,7 @@
{% if tag.device %} - {{ tag.device.type }} {{ tag.device.manufacturer|d('', true) }} {{ tag.device.model|d('', true) }} + {{ tag.device.verbose_name }} {% endif %}
diff --git a/ereuse_devicehub/templates/inventory/tag_list.html b/ereuse_devicehub/templates/inventory/tag_list.html index 519debab..b385dfc8 100644 --- a/ereuse_devicehub/templates/inventory/tag_list.html +++ b/ereuse_devicehub/templates/inventory/tag_list.html @@ -58,7 +58,7 @@ {% if tag.device %} - {{ tag.device.type }} {{ tag.device.manufacturer|d('', true) }} {{ tag.device.model|d('', true) }} + {{ tag.device.verbose_name }} {% endif %}