From f3bbdee629c86fc388da4d3a84150689a0626419 Mon Sep 17 00:00:00 2001 From: Marcin Wielgoszewski Date: Thu, 31 Aug 2017 12:32:28 -0400 Subject: [PATCH] Join Query table so we don't have to execute a separate sql statement to get query info --- doorman/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doorman/utils.py b/doorman/utils.py index ed31e3c..33d102f 100644 --- a/doorman/utils.py +++ b/doorman/utils.py @@ -70,7 +70,8 @@ def assemble_schedule(node): def assemble_packs(node): packs = {} - for pack in node.packs.join(querypacks): + for pack in node.packs.join(querypacks).join(Query) \ + .options(db.contains_eager(Pack.queries)).all(): packs[pack.name] = pack.to_dict() return packs