#10233: X.objects.filter(...) works, X.objects.exclude(...) fails in 1.0.x
------------------------------------------+---------------------------------
 Reporter:  andrewl                       |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.0       
 Keywords:  filter, exclude, SQL          |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 While an X.objects.filter(...) works, the equivalent
 X.objects.exclude(...) fails under Django 1.0.x.

 The exclusion condition seems to need at least 3 levels of 'redirection'
 (for want of a better term) for the failure to occur. For example:

      X.objects.exclude(a='foo')       -- OK
      X.objects.exclude(a__b='foo')    -- OK
      X.objects.exclude(a__b__c='foo') -- FAIL

 The equivalent X.objects.filter(...) succeeds. Also I have not tested
 higher levels of redirection than 3.

 Note that this appears to be fixed in Django TRUNK (which was at revision
 9821 at the time of submitting this ticket).

 Please refer to the attached file for a concrete query example showing the
 SQL produced under Django 1.0.x (tagged releases 1.0 and 1.0.2 tested) and
 Django TRUNK.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10233>
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