xapian #1

Merged
cayop merged 26 commits from xapian into master 2024-09-17 10:11:28 +00:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit e2f9855954 - Show all commits

View File

@ -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()

View File

@ -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">