Lorian requested item search box
[htsworkflow.git] / htsworkflow / frontend / inventory / admin.py
index 70e12b8b016d264c467253b00caae9385c9f6409..f6d0740d383fd41260d03417cb840fc92fea4b77 100644 (file)
@@ -1,12 +1,26 @@
 from django.contrib import admin
 
-from htsworkflow.frontend.inventory.models import Item, ItemInfo, ItemType, Vendor, Location, LongTermStorage
+from htsworkflow.frontend.inventory.models import Item, ItemInfo, ItemType, Vendor, Location, LongTermStorage, ItemStatus, ReagentFlowcell, ReagentLibrary
 
 class ItemAdmin(admin.ModelAdmin):
+    save_as = True
+    save_on_top = True
     list_display = ('uuid', 'barcode_id','item_type', 'item_info', 'location', 'force_use_uuid', 'creation_date')
+    list_filter = (
+        'item_type',
+    )
+    search_fields = [
+        'barcode_id',
+        'uuid',
+        'status__name',
+        'item_type__name',
+        'location__name',
+        'notes'
+    ]
 
 class ItemInfoAdmin(admin.ModelAdmin):
-    pass
+    save_as = True
+    save_on_top = True
 
 class ItemTypeAdmin(admin.ModelAdmin):
     pass
@@ -20,9 +34,22 @@ class LocationAdmin(admin.ModelAdmin):
 class LongTermStorageAdmin(admin.ModelAdmin):
     pass
 
+class ItemStatusAdmin(admin.ModelAdmin):
+    pass
+
+class ReagentFlowcellAdmin(admin.ModelAdmin):
+    pass
+
+class ReagentLibraryAdmin(admin.ModelAdmin):
+    pass
+
 admin.site.register(Item, ItemAdmin)
 admin.site.register(ItemInfo, ItemInfoAdmin)
 admin.site.register(ItemType, ItemTypeAdmin)
 admin.site.register(Vendor, VendorAdmin)
 admin.site.register(Location, LocationAdmin)
 admin.site.register(LongTermStorage, LongTermStorageAdmin)
+admin.site.register(ItemStatus, ItemStatusAdmin)
+admin.site.register(ReagentFlowcell, ReagentFlowcellAdmin)
+admin.site.register(ReagentLibrary, ReagentLibraryAdmin)
+