#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 Wojciech Banaś <fizista@…>):

 Replying to [comment:7 andreypopp]:
 > 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.

 Your comments were very useful. Have combined your ideas with me, and I
 received a very short and working code ([[ticket:17270]], see attachment
 ''manager.3.py'').

 Do you think that this solution would be good now?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17271#comment:8>
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.

Reply via email to