summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-04-23 16:29:40 +0200
committerDan McGee <dan@archlinux.org>2013-04-23 16:29:40 +0200
commitac1c00ee86cc0e355af5e4e6be47ca861091356b (patch)
treea76b43c56cdc8f21edf6852c26b6c3ed0f1ade4d
parent6fa6a8db0787fa40fa1c88b725b0bce184903c4c (diff)
downloadarchweb-ac1c00ee86cc0e355af5e4e6be47ca861091356b.tar.gz
archweb-ac1c00ee86cc0e355af5e4e6be47ca861091356b.tar.xz
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 <dan@archlinux.org>
-rw-r--r--packages/utils.py3
1 files changed, 2 insertions, 1 deletions
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):