#12851: Queryset "defer" won't work properly with select_related
---------------------------------------------------+------------------------
          Reporter:  ruosteinen                    |         Owner:  nobody     
                          
            Status:  new                           |     Milestone:  1.2        
                          
         Component:  Database layer (models, ORM)  |       Version:  1.2-beta   
                          
        Resolution:                                |      Keywords:  
select_related, defer, nesting, query
             Stage:  Accepted                      |     Has_patch:  0          
                          
        Needs_docs:  0                             |   Needs_tests:  0          
                          
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by russellm):

  * stage:  Unreviewed => Accepted
  * milestone:  => 1.2

Comment:

 @carljm - Agreed: "Earth" should be the expected result. Either way, it's
 not working - pm.target.location is returning an empty string.

 @ruosteinen - Although #10733 also deals with select_related() +
 defer()/only() problems, I'm not immediately convinced that it is the same
 problem (at least, not enough to close this as a duplicate).#10733 deals
 with having multiple joins to the same table; this ticket is about
 traversing a join correctly. I suspect the problem here is something to do
 with populating the related object cache correctly - the query is doing
 the join as it should, but because the query defers the only data field on
 the related object, and it is being deferred, the deferred class isn't
 being instantiated correctly.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12851#comment:4>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to