diff options
author | Dan McGee <dan@archlinux.org> | 2010-01-31 16:42:12 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-01-31 16:42:12 -0600 |
commit | 382d36f4bfb5855bbe6154324229d1e2de447f62 (patch) | |
tree | a3b7b15a2b1d754aa42220089b26045e654712f8 /main | |
parent | b1a5a6d968b5062abd72c8c87c3511e220aeaa35 (diff) |
Make looking up a package with many required by entries faster
We were doing a 2 queries for each 'Required By' entry- arch and repo as
usual. Add it to the original query so we don't waste time.
Noticed while looking at the glibc description page.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r-- | main/models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/models.py b/main/models.py index 8d5da3bc..570221bf 100644 --- a/main/models.py +++ b/main/models.py @@ -205,7 +205,7 @@ class Package(models.Model): """ Returns a list of package objects. """ - requiredby = Package.objects.filter( + requiredby = Package.objects.select_related('arch', 'repo').filter( packagedepend__depname=self.pkgname, arch__name__in=(self.arch.name, 'Any')) return requiredby.order_by('pkgname') |