Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…agle eyes.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15324 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a9b4f2a40043cdf8e61dce7e623028ba33ffd6af 1 parent 8151c04
Carl Meyer authored January 26, 2011

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  django/db/models/sql/query.py
3  django/db/models/sql/query.py
@@ -1367,7 +1367,8 @@ def setup_joins(self, names, opts, alias, dupe_multis, allow_many=True,
1367 1367
                         # In case of a recursive FK, use the to_field for
1368 1368
                         # reverse lookups as well
1369 1369
                         if orig_field.model is local_field.model:
1370  
-                            target = opts.get_field(field.rel.field_name)
  1370
+                            target = opts.get_field_by_name(
  1371
+                                field.rel.field_name)[0]
1371 1372
                         else:
1372 1373
                             target = opts.pk
1373 1374
                         orig_opts._join_cache[name] = (table, from_col, to_col,

0 notes on commit a9b4f2a

Please sign in to comment.
Something went wrong with that request. Please try again.