fix view lots in details of device
This commit is contained in:
parent
4df2efd8ad
commit
9d42c27bd4
|
@ -33,6 +33,7 @@ class Device:
|
||||||
self.hids = []
|
self.hids = []
|
||||||
self.uuids = []
|
self.uuids = []
|
||||||
self.evidences = []
|
self.evidences = []
|
||||||
|
self.lots = []
|
||||||
self.last_evidence = None
|
self.last_evidence = None
|
||||||
self.get_last_evidence()
|
self.get_last_evidence()
|
||||||
|
|
||||||
|
@ -41,6 +42,7 @@ class Device:
|
||||||
self.get_uuids()
|
self.get_uuids()
|
||||||
self.get_hids()
|
self.get_hids()
|
||||||
self.get_evidences()
|
self.get_evidences()
|
||||||
|
self.get_lots()
|
||||||
|
|
||||||
def get_annotations(self):
|
def get_annotations(self):
|
||||||
if self.annotations:
|
if self.annotations:
|
||||||
|
@ -107,6 +109,9 @@ class Device:
|
||||||
def last_uuid(self):
|
def last_uuid(self):
|
||||||
return self.uuids[0]
|
return self.uuids[0]
|
||||||
|
|
||||||
|
def get_lots(self):
|
||||||
|
self.lots = [x.lot for x in DeviceLot.objects.filter(device_id=self.id)]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_unassigned(cls, user):
|
def get_unassigned(cls, user):
|
||||||
chids = DeviceLot.objects.filter(lot__owner=user).values_list("device_id", flat=True).distinct()
|
chids = DeviceLot.objects.filter(lot__owner=user).values_list("device_id", flat=True).distinct()
|
||||||
|
|
|
@ -121,7 +121,7 @@
|
||||||
{% for tag in lot_tags %}
|
{% for tag in lot_tags %}
|
||||||
<h5 class="card-title">{{ tag }}</h5>
|
<h5 class="card-title">{{ tag }}</h5>
|
||||||
|
|
||||||
{% for lot in tag.lot_set.filter %}
|
{% for lot in object.lots %}
|
||||||
{% if lot.type == tag %}
|
{% if lot.type == tag %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
Loading…
Reference in New Issue