#11319: ForeignKey filters use the wrong field to prepare values for database
---------------------------------------------------+------------------------
          Reporter:  russellm                      |         Owner:  carljm
            Status:  new                           |     Milestone:  1.3   
         Component:  Database layer (models, ORM)  |       Version:  1.0   
        Resolution:                                |      Keywords:        
             Stage:  Accepted                      |     Has_patch:  1     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  1                             |  
---------------------------------------------------+------------------------
Comment (by russellm):

 @carljm -- thanks for taking a look at this one Carl.

 The change to related.py looks correct to me.

 The change to query.py raises a slight bell to me, though. It's a definite
 improvement, catching at least one problem case. However, are you sure
 that this is only a problem with recursive models? I would have thought
 that branch of code would have triggered on any reverse to_field lookup --
 in which case, 'rel.to_field is None'-type logic, analogous to that used
 by your change in related.py, would seem appropriate.

 That said, it looks like the queries test takes reverse to_field queries
 for a bit of a walk; so I might be completely off.

 So - it's probably worth having a bit of a poke in that general area to
 see if you can manufacture a test case that breaks; if you can't, and the
 test suite passes, I'd be happy to see this land in trunk.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11319#comment:14>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to