summaryrefslogtreecommitdiff
path: root/packages/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-04-07 15:13:37 -0500
committerDan McGee <dan@archlinux.org>2011-04-07 17:01:44 -0500
commitecfcdfda941ef0c991300c6eb25fe336c3fd9cbe (patch)
treeefb2eec3a77a624e1f7ddad2ec3da616497d06b9 /packages/views.py
parent0d3e1eb796d673607bb8beb91c61114209fd9155 (diff)
Select related needed objects when pulling package details
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views.py')
-rw-r--r--packages/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/views.py b/packages/views.py
index 263165fd..2f614e34 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -84,7 +84,8 @@ def update(request):
def details(request, name='', repo='', arch=''):
if all([name, repo, arch]):
try:
- pkg = Package.objects.get(pkgname=name,
+ pkg = Package.objects.select_related(
+ 'arch', 'repo', 'packager').get(pkgname=name,
repo__name__iexact=repo, arch__name=arch)
return direct_to_template(request, 'packages/details.html',
{'pkg': pkg, })