From c31da9171681cbc1b7bc5586531c324eb10974d3 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Wed, 22 Oct 2025 13:42:19 -0500 Subject: [PATCH] Filters completed. --- inventory/routes/entry.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inventory/routes/entry.py b/inventory/routes/entry.py index fa607b3..895a5e1 100644 --- a/inventory/routes/entry.py +++ b/inventory/routes/entry.py @@ -47,7 +47,8 @@ def _fields_for_model(model: str): "attrs": {"class": "form-control"}, "label": "Device Type", "label_attrs": {"class": "form-label"}}, {"name": "owner", "row": "status", "label": "Contact", "wrap": {"class": "col"}, "attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"}, - "label_spec": "{label}", "link": {"endpoint": "entry.entry", "params": {"model": "user", "id": "{owner.id}"}}}, + "label_spec": "{label}", "link": {"endpoint": "entry.entry", "params": {"model": "user", "id": "{owner.id}"}}, + "options_params": {"active__eq": True}}, {"name": "location", "row": "status", "label": "Location", "wrap": {"class": "col"}, "attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"}, "label_spec": "{name} - {room_function.description}"}, @@ -144,10 +145,12 @@ def _fields_for_model(model: str): "wrap": {"class": "col-auto text-end me-2"}, "attrs": {"data-model": model}}, {"name": "contact", "row": "ownership", "wrap": {"class": "col"}, "label": "Contact", "label_spec": "{label}", "attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"}, - "link": {"endpoint": "entry.entry", "params": {"id": "{contact.id}", "model": "user"}}}, + "link": {"endpoint": "entry.entry", "params": {"id": "{contact.id}", "model": "user"}}, + "options_params": {"active__eq": True}}, {"name": "work_item", "row": "ownership", "wrap": {"class": "col"}, "label": "Work Item", "label_spec": "{label}", "attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"}, - "link": {"endpoint": "entry.entry", "params": {"id": "{work_item.id}", "model": "inventory"}}}, + "link": {"endpoint": "entry.entry", "params": {"id": "{work_item.id}", "model": "inventory"}}, + "options_params": {"condition__nin": ["Removed", "Disposed"]}}, {"name": "start_time", "type": "datetime", "attrs": {"class": "form-control"}, "row": "timestamps", "wrap": {"class": "col"}, "label_attrs": {"class": "form-label"}, "label": "Start"}, {"name": "end_time", "type": "datetime", "attrs": {"class": "form-control"}, "row": "timestamps",