#25467: Excluding an object with no ID excludes everything.
-------------------------------------+-------------------------------------
Reporter: skorokithakis | Owner: nobody
Type: Bug | Status: new
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 HuffAndPuff):
Posting some thoughts on this one...
If we '''don't''' raise an exception, we would instead need to define how
a None is handled in all Related lookups. Semantically it means "compare
to something that is not in the database" right? At least that's how I
would interpret it.
The lookups returned by a ForeignObject are `in`, `exact`, `gt`, `gte`,
`lt`, `lte` and `isnull`. The `isnull` one is not really a problem.
The scenarios I can think of for the other ones are:
* `__in=[1,2,None]`
* `__in=[None]`
* `__exact=None`
* Plus the greater/less than comparisons, what does it mean to say
"greater than None" where None semantically means "no matching row"?
--
Ticket URL: <https://code.djangoproject.com/ticket/25467#comment:6>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/071.8ba2af4945463f81b4d0ea7713328244%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.