diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 67f4bb80..5f1ccb20 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -653,6 +653,21 @@ class Device(Thing): args[POLYMORPHIC_ON] = cls.type return args + def get_lots_for_template(self): + lots = [] + for lot in self.lots: + if lot.is_incoming: + name = "IN - " + lot.name + lots.append(name) + if lot.is_outgoing: + name = "OUT - " + lot.name + lots.append(name) + if lot.is_temporary: + name = "TEMP - " + lot.name + lots.append(name) + lots.sort() + return lots + def phid(self): if self.placeholder: return self.placeholder.phid diff --git a/ereuse_devicehub/templates/inventory/device_list.html b/ereuse_devicehub/templates/inventory/device_list.html index 737d556b..9e43c4ba 100644 --- a/ereuse_devicehub/templates/inventory/device_list.html +++ b/ereuse_devicehub/templates/inventory/device_list.html @@ -376,8 +376,8 @@ {% if dev.lots | length > 0 %}