summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-03 22:05:35 -0500
committerDan McGee <dan@archlinux.org>2011-11-03 22:05:35 -0500
commit278d74b1d12568d4c9b6d5533e57e820d038ae64 (patch)
tree128010ff9071b36dec6244b65727c1856b3d07b9
parent0aa42e2c01df2bf1c9e425994420f5ae10252597 (diff)
Minor signoff query tweaks/optimizations
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--packages/utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/utils.py b/packages/utils.py
index 1a2c0de0..65769baf 100644
--- a/packages/utils.py
+++ b/packages/utils.py
@@ -248,8 +248,7 @@ SELECT DISTINCT s.id
AND s.arch_id = p.arch_id
AND s.repo_id = p.repo_id
)
- JOIN repos r ON p.repo_id = r.id
- WHERE r.id IN (
+ WHERE p.repo_id IN (
"""
sql += ", ".join("%s" for r in repos)
sql += ")"
@@ -264,15 +263,16 @@ SELECT DISTINCT s.id
def get_target_repo_map(pkgbases):
package_repos = Package.objects.order_by().values_list(
'pkgbase', 'repo__name').filter(
- repo__testing=False, repo__staging=False,
pkgbase__in=pkgbases).distinct()
return dict(package_repos)
def get_signoff_groups(repos=None):
if repos is None:
repos = Repo.objects.filter(testing=True)
+ repo_ids = [r.pk for r in repos]
- test_pkgs = Package.objects.normal().filter(repo__in=repos)
+ test_pkgs = Package.objects.select_related(
+ 'arch', 'repo', 'packager').filter(repo__in=repo_ids)
packages = test_pkgs.order_by('pkgname')
# Collect all pkgbase values in testing repos