#17271: QuerySet.none() doesn't work well with subclasses of QuerySet
-------------------------------------+-------------------------------------
Reporter: andreypopp | Owner: nobody
Type: New feature | Status: reopened
Component: Database layer | Version: SVN
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by carljm):
* status: closed => reopened
* resolution: duplicate =>
* stage: Unreviewed => Accepted
Comment:
Replying to [comment:9 lukeplant]:
> Special casing the `none()` method doesn't seem very compelling compared
to #17270 which addresses the larger problem, therefore closing this bug
as a duplicate of #17270.
I don't agree with this resolution. I am not at all convinced that the
technique in #17270 is a candidate for core (although it can be nice as a
third-party module), as it adds a bunch of extra runtime code execution
and implicit magical behavior to every single ORM call. And it's not
really addressing the same problem at all: it's addressing the difference
between a `Manager` and a `QuerySet`, not the difference between a
`QuerySet` and an `EmptyQuerySet`. If you look at the patch there, it only
fixes this problem too because it special-cases `.none()` and
`EmptyQuerySet` every bit as much as a patch for this would. In other
words, these are two separate issues, it just happens that #17270
conflates fixes for both of them into a single patch.
In any case, `.none()` is already special-cased by the existence of
`EmptyQuerySet` - this bug is just looking for a remedy to the
consequences of that existing special-case. I think it's a legitimate, and
separate, bug.
--
Ticket URL: <https://code.djangoproject.com/ticket/17271#comment:11>
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 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.