summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-03 23:30:16 -0500
committerDan McGee <dan@archlinux.org>2011-11-03 23:30:16 -0500
commit0db2830b8fda4d898a184a31f3375c10f3cc4083 (patch)
treefed2700088e1f03ffcd9af906184d81f199955fc /packages
parent19c2841f20653fd3c59f73fdb16f7f7b1ea15434 (diff)
Make maintainer lookup on todo lists fast
This is rather sick to look at. Sorry, Django gives me no other choice. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/utils.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/packages/utils.py b/packages/utils.py
index 0d756a85..4af0f67d 100644
--- a/packages/utils.py
+++ b/packages/utils.py
@@ -156,6 +156,7 @@ def attach_maintainers(packages):
'''Given a queryset or something resembling it of package objects, find all
the maintainers and attach them to the packages to prevent N+1 query
cascading.'''
+ packages = list(packages)
pkgbases = set(p.pkgbase for p in packages)
rels = PackageRelation.objects.filter(type=PackageRelation.MAINTAINER,
pkgbase__in=pkgbases).values_list('pkgbase', 'user_id').distinct()