summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2011-11-29 12:50:10 +0000
committerLuke Plant <L.Plant.98@cantab.net>2011-11-29 12:50:10 +0000
commitf2ebb169f9bf195a7c8126437708a482691a520d (patch)
treea22e98eed55cb4796c25db2215ed24f67ec5f891
parent16ad0530c5d86dccff3952c52dff9f3138a205a5 (diff)
Small code clarification in prefetch_related code using better variable names
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17162 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/models/query.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index be42d02006..80cdefd22e 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -1576,12 +1576,11 @@ def prefetch_related_objects(result_cache, related_lookups):
done_lookups = set() # list of lookups like foo__bar__baz
done_queries = {} # dictionary of things like 'foo__bar': [results]
- manual_lookups = list(related_lookups)
auto_lookups = [] # we add to this as we go through.
followed_descriptors = set() # recursion protection
- related_lookups = itertools.chain(manual_lookups, auto_lookups)
- for lookup in related_lookups:
+ all_lookups = itertools.chain(related_lookups, auto_lookups)
+ for lookup in all_lookups:
if lookup in done_lookups:
# We've done exactly this already, skip the whole thing
continue