diff options
author | Dan McGee <dan@archlinux.org> | 2011-11-03 22:05:35 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-11-03 22:05:35 -0500 |
commit | 278d74b1d12568d4c9b6d5533e57e820d038ae64 (patch) | |
tree | 128010ff9071b36dec6244b65727c1856b3d07b9 /packages/utils.py | |
parent | 0aa42e2c01df2bf1c9e425994420f5ae10252597 (diff) |
Minor signoff query tweaks/optimizations
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/utils.py')
-rw-r--r-- | packages/utils.py | 8 |
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 |