From ac1c00ee86cc0e355af5e4e6be47ca861091356b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 23 Apr 2013 09:29:40 -0500 Subject: When retrieving signoff specs, select the arch object as well Otherwise we do one query per row in the signoff table to fetch the architecture and it's required_signoffs value, which is less than ideal. Signed-off-by: Dan McGee --- packages/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/utils.py b/packages/utils.py index b8d1504..6ec3948 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -410,7 +410,8 @@ def get_current_signoffs(repos): def get_current_specifications(repos): '''Returns a list of signoff specification objects for the given repos.''' to_fetch = signoffs_id_query(SignoffSpecification, repos) - return SignoffSpecification.objects.in_bulk(to_fetch).values() + return SignoffSpecification.objects.select_related('arch').in_bulk( + to_fetch).values() def get_target_repo_map(repos): -- cgit v1.2.3-24-g4f1b