From 4a9b6867a3a2786435316ab7deefa54257bb931d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 15 Jun 2011 15:50:14 -0500 Subject: Refactor common select_related into manager method For a Package object query, we almost always did .select_related('arch', 'repo). Refactor this into the manager as a 'normal()' method so we can avoid sprinkling the same logic everywhere. Signed-off-by: Dan McGee --- packages/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/utils.py') diff --git a/packages/utils.py b/packages/utils.py index 29a3087..af4675b 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -108,7 +108,7 @@ SELECT p.id, q.id # 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.select_related('arch', 'repo').in_bulk(to_fetch) + pkgs = Package.objects.normal().in_bulk(to_fetch) # now build a list of tuples containing differences differences = [] for row in results: -- cgit v1.2.3-24-g4f1b