#10723: ORM exclute strange
---------------------------------------------------+------------------------
          Reporter:  anonymous                     |         Owner:  nobody
            Status:  closed                        |     Milestone:  1.1   
         Component:  Database layer (models, ORM)  |       Version:  SVN   
        Resolution:  invalid                       |      Keywords:        
             Stage:  Accepted                      |     Has_patch:  0     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by mtredinnick):

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

Comment:

 No, your SQL isn't correct here. It would not exclude all the results if,
 say, there were multiple Active records involved, with user_ids of 1 and
 4, say. The user_id of 4 would allow that record to slip through the
 filter, when your queryest is asking to exclude anything with at least one
 record matching 1, 2 or 3 for user_id values.

 Multi-valued relations are tricky like that. The SQL Django is generating
 is necessary here. This isn't a bug.

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