X-Git-Url: http://woldlab.caltech.edu/gitweb/?a=blobdiff_plain;f=htsworkflow%2Ffrontend%2Finventory%2Fviews.py;h=3c72d207590e4e03c1b3a22bd41097870730b962;hb=a4edf9e7cd803cb4f5864074d76c24deb30a6ead;hp=8273717874c8b7aec371d4ba29a71e4ed01fbf1b;hpb=42f1257e51400d2961e677b03d9fbf011c7742f7;p=htsworkflow.git diff --git a/htsworkflow/frontend/inventory/views.py b/htsworkflow/frontend/inventory/views.py index 8273717..3c72d20 100644 --- a/htsworkflow/frontend/inventory/views.py +++ b/htsworkflow/frontend/inventory/views.py @@ -29,8 +29,26 @@ def data_items(request): item_d = {} item_d['uuid'] = item.uuid item_d['barcode_id'] = item.barcode_id + item_d['model_id'] = item.item_info.model_id + item_d['part_number'] = item.item_info.part_number + item_d['lot_number'] = item.item_info.lot_number + item_d['vendor'] = item.item_info.vendor.name item_d['creation_date'] = item.creation_date.strftime('%Y-%m-%d %H:%M:%S') item_d['modified_date'] = item.modified_date.strftime('%Y-%m-%d %H:%M:%S') + item_d['location'] = item.location.name + + # Item status if exists + if item.status is None: + item_d['status'] = '' + else: + item_d['status'] = item.status.name + + # Stored flowcells on device + if item.longtermstorage_set.count() > 0: + item_d['flowcells'] = ','.join([ lts.flowcell.flowcell_id for lts in item.longtermstorage_set.all() ]) + else: + item_d['flowcells'] = '' + item_d['type'] = item.item_type.name rows.append(item_d) @@ -38,6 +56,7 @@ def data_items(request): return HttpResponse(encode_json(d), content_type="application/javascript") + def index(request): """ Inventory Index View