From 2edf427e1586a50ce348ca9574bb50fd3e92ba98 Mon Sep 17 00:00:00 2001 From: agmes4 Date: Sat, 16 Mar 2024 19:10:24 +0100 Subject: [PATCH] Infrastructure: Optimized load added an joinedload for the Switches so there is not allways a new request solves: #699 --- web/blueprints/infrastructure/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/blueprints/infrastructure/__init__.py b/web/blueprints/infrastructure/__init__.py index 0e13c7250..fb971e9cb 100644 --- a/web/blueprints/infrastructure/__init__.py +++ b/web/blueprints/infrastructure/__init__.py @@ -129,7 +129,7 @@ def switches_json() -> ResponseValue: btn_class="btn-link", ), ) - for switch in Switch.q.all() + for switch in Switch.q.options(joinedload(Switch.host)).all() ] ).model_dump()