#25467: Excluding an object with no ID excludes everything.
-------------------------------------+-------------------------------------
     Reporter:  skorokithakis        |                    Owner:
                                     |  HuffAndPuff
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by skorokithakis):

 I think that thinking about this in terms of the value of the ID field is
 misleading. The ID value being None is just an implementation detail, it
 could very well be the future numeric ID (if Django could know this before
 talking to the DB), in which case the query would become
 `.exclude(related_field=<an ID that's not in the DB yet>)`, which matches
 the intuitive reasoning behind that `exclude` call.

 For that reason, i would strongly suggest option (a) that you mentioned
 over the other two.

--
Ticket URL: <https://code.djangoproject.com/ticket/25467#comment:10>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.8b2479648c45ff61dbf9f12eef4bb7ef%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to