Match the optional identifiers in every list's search box

This commit is contained in:
2026-08-17 13:18:26 -04:00
parent fbd99041b0
commit 49f68081c3
6 changed files with 109 additions and 0 deletions

View File

@@ -375,6 +375,11 @@ def list_computers():
Asset.assetnumber.ilike(pattern),
Asset.name.ilike(pattern),
Asset.serialnumber.ilike(pattern),
# The optional identifiers too (ADR-001). Global search matches
# these, and a tag read off the machine has to find it here as
# well - this box is where someone holding the label looks.
Asset.gaugelabreference.ilike(pattern),
Asset.maintenancereference.ilike(pattern),
Computer.hostname.ilike(pattern),
ComputerType.computertype.ilike(pattern)
)

View File

@@ -189,6 +189,11 @@ def list_machines():
Asset.assetnumber.ilike(pattern),
Asset.name.ilike(pattern),
Asset.serialnumber.ilike(pattern),
# The optional identifiers too (ADR-001). Global search matches
# these, and a tag read off the machine has to find it here as
# well - this box is where someone holding the label looks.
Asset.gaugelabreference.ilike(pattern),
Asset.maintenancereference.ilike(pattern),
MachineType.machinetype.ilike(pattern),
Vendor.vendor.ilike(pattern)
)

View File

@@ -179,6 +179,11 @@ def list_tools():
Asset.assetnumber.ilike(pattern),
Asset.name.ilike(pattern),
Asset.serialnumber.ilike(pattern),
# The optional identifiers too (ADR-001). Global search matches
# these, and a tag read off the machine has to find it here as
# well - this box is where someone holding the label looks.
Asset.gaugelabreference.ilike(pattern),
Asset.maintenancereference.ilike(pattern),
MeasuringToolType.name.ilike(pattern),
))
if type_id := request.args.get('typeid', type=int):

View File

@@ -223,6 +223,11 @@ def list_network_devices():
Asset.assetnumber.ilike(pattern),
Asset.name.ilike(pattern),
Asset.serialnumber.ilike(pattern),
# The optional identifiers too (ADR-001). Global search matches
# these, and a tag read off the machine has to find it here as
# well - this box is where someone holding the label looks.
Asset.gaugelabreference.ilike(pattern),
Asset.maintenancereference.ilike(pattern),
NetworkDevice.hostname.ilike(pattern),
NetworkDeviceType.networkdevicetype.ilike(pattern),
Vendor.vendor.ilike(pattern)

View File

@@ -254,6 +254,11 @@ def list_printers():
Asset.assetnumber.ilike(pattern),
Asset.name.ilike(pattern),
Asset.serialnumber.ilike(pattern),
# The optional identifiers too (ADR-001). Global search matches
# these, and a tag read off the machine has to find it here as
# well - this box is where someone holding the label looks.
Asset.gaugelabreference.ilike(pattern),
Asset.maintenancereference.ilike(pattern),
Printer.hostname.ilike(pattern),
Printer.windowsname.ilike(pattern),
PrinterType.printertype.ilike(pattern),