Kaydet (Commit) a9b4f2a4 authored tarafından Carl Meyer's avatar Carl Meyer

Tweaked r15303 to avoid O(N) lookup of field name. Thanks to Alex's eagle eyes.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15324 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 8151c043
......@@ -1367,7 +1367,8 @@ class Query(object):
# In case of a recursive FK, use the to_field for
# reverse lookups as well
if orig_field.model is local_field.model:
target = opts.get_field(field.rel.field_name)
target = opts.get_field_by_name(
field.rel.field_name)[0]
else:
target = opts.pk
orig_opts._join_cache[name] = (table, from_col, to_col,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment