#17271: QuerySet.none() doesn't work well with subclasses of QuerySet
-------------------------------------+-------------------------------------
Reporter: andreypopp | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: SVN
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by andreypopp):
Replying to [comment:6 Wojciech Banaś <fizista@…>]:
> The same you can get by using my patch, and filters are where they
should, in the manager.
>
> See my examples in this ticket [[ticket:17270]]
Yep, indeed, I actually wondered if I could provide all methods on
`Manager` and `QuerySet` simultaneously and haven't found any solutions
which look good. Your patch implements this correctly but I think it:
* suffers from performance degradation(very much code are executed during
`get_query_set()` call which isn't rare call, I think)
* doesn't work if `Manager` implements `__getattr__`
There's also a strange spot if `QuerySet` already has some methods — you
decided not to override such methods and I think it's good decision while
it also makes some implicit assumptions which can confuse users and create
new "special case" in documentation.
For me the better and the bigger spot to touch is to completely merge
`Manager` and `QuerySet` classes into one unit or just expose only on them
in API.
--
Ticket URL: <https://code.djangoproject.com/ticket/17271#comment:7>
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.