From e2f5358d830943725bae3109f16011583a053974 Mon Sep 17 00:00:00 2001 From: pedro Date: Thu, 26 Sep 2024 00:22:21 -0300 Subject: [PATCH] add shortid and refactor unassigned devices table --- dashboard/templates/unassigned_devices.html | 25 +++++++++++++++++++-- device/models.py | 1 + device/templates/details.html | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/dashboard/templates/unassigned_devices.html b/dashboard/templates/unassigned_devices.html index c21a2be..8d894ed 100644 --- a/dashboard/templates/unassigned_devices.html +++ b/dashboard/templates/unassigned_devices.html @@ -33,7 +33,19 @@ - Title + select + + + shortid + + + type + + + manufacturer + + + model @@ -45,9 +57,18 @@ - {{ dev.type }} {{ dev.manufacturer }} {{ dev.model }} + {{ dev.shortid }} + + {{ dev.type }} + + + {{ dev.manufacturer }} + + + {{ dev.model }} + {% endfor %} diff --git a/device/models.py b/device/models.py index c9e04ec..1bf4bcc 100644 --- a/device/models.py +++ b/device/models.py @@ -27,6 +27,7 @@ class Device: # the id is the chid of the device self.id = kwargs["id"] self.pk = self.id + self.shortid = self.pk[:6] self.algorithm = None self.owner = None self.annotations = [] diff --git a/device/templates/details.html b/device/templates/details.html index b757b1f..37f7487 100644 --- a/device/templates/details.html +++ b/device/templates/details.html @@ -4,7 +4,7 @@ {% block content %}
-

{{ object.id }}

+

{{ object.shortid }}