From 11f0db759bb04d0dce303de91c6df441cdf0bfee Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 4 Oct 2010 17:37:39 -0500 Subject: Add some select_related() magic Made obvious when poking around with the Django debug toolbar. Signed-off-by: Dan McGee --- packages/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/utils.py b/packages/utils.py index 55b7acf9..93d0de79 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -104,7 +104,7 @@ def get_differences_info(arch_a, arch_b): # column A will always have a value, column B might be NULL to_fetch.append(row[0]) # fetch all of the necessary packages - pkgs = Package.objects.in_bulk(to_fetch) + pkgs = Package.objects.select_related('arch', 'repo').in_bulk(to_fetch) # now build a list of tuples containing differences differences = [] for row in results: -- cgit v1.2.3-54-g00ecf