diff options
author | Dan McGee <dan@archlinux.org> | 2010-01-31 22:19:12 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-01-31 22:19:12 +0100 |
commit | f58b354a037d2c46fd8db9320f8ba29c9e014436 (patch) | |
tree | 05aaea7bcd1a055af9d873482a40b7ecdc44a082 /public | |
parent | e0eed01914752ee98d50aeab748f71b24df94dc6 (diff) | |
download | archweb-f58b354a037d2c46fd8db9320f8ba29c9e014436.tar.gz archweb-f58b354a037d2c46fd8db9320f8ba29c9e014436.tar.xz |
Use select_related() to make a few more places more performant
Especially when looking at packages, we always want the arch and repo.
Another big hunk of changes deals with the very inefficient signoffs code.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'public')
-rw-r--r-- | public/views.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/public/views.py b/public/views.py index b44b02a..7f703c4 100644 --- a/public/views.py +++ b/public/views.py @@ -10,7 +10,7 @@ from django.views.generic import list_detail def index(request): context = { 'news_updates': News.objects.order_by('-postdate', '-id')[:10], - 'pkg_updates': Package.objects.order_by('-last_update')[:15], + 'pkg_updates': Package.objects.select_related('arch', 'repo').order_by('-last_update')[:15], 'repos': Repo.objects.all() } return render_to_response('public/index.html', context, |