#3149: select_related() filters objects with ANY fk foreign relation
------------------------------------------+---------------------------------
   Reporter:  Doug Napoleone              |                Owner:  adrian       
   
     Status:  closed                      |            Component:  Database 
wrapper
    Version:  SVN                         |           Resolution:  worksforme   
   
   Keywords:  select_related() null=True  |                Stage:  Unreviewed   
   
  Has_patch:  0                           |           Needs_docs:  0            
   
Needs_tests:  0                           |   Needs_better_patch:  0            
   
------------------------------------------+---------------------------------
Changes (by Michael Radziej <[EMAIL PROTECTED]>):

  * status:  new => closed
  * resolution:  => worksforme

Comment:

 I tried this, but I get different results. Perhaps this has been fixed in
 the meantime.
 
 models:
 
 {{{
 from django.db import models
 
 class A(models.Model):
     pass
 
 class B(models.Model):
     a = models.ForeignKey(A, null=True)
 }}}
 
 shell:
 
 {{{
 In [1]: from testproj.testapp import models;
 
 In [2]: models.B.objects.create()
 Out[2]: <B: B object>
 
 In [3]: models.B.objects.filter(a__isnull=True)
 Out[3]: [<B: B object>]
 
 In [4]: models.B.objects.filter(a__isnull=True).select_related()
 Out[4]: [<B: B object>]
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3149#comment:2>
Django Code <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