From f58b354a037d2c46fd8db9320f8ba29c9e014436 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 31 Jan 2010 15:19:12 -0600 Subject: 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 --- public/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'public/views.py') diff --git a/public/views.py b/public/views.py index b44b02ab..7f703c4a 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, -- cgit v1.2.3-55-g3dc8