#15363: get_queryset & get_query_set
--------------------------------------+------------------------------------
     Reporter:  sorl                  |                    Owner:  loic84
         Type:  Cleanup/optimization  |                   Status:  assigned
    Component:  Core (Other)          |                  Version:  master
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  1
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by akaariai):

 It is still possible to break this by mixins or plain method assignment.
 Of these mixins might be actually used in the wild.

 The mixins example is:
 {{{
 class ManagerMixin(object):
     def get_query_set(self):
         ...

 class MyManager(ManagerMixin, models.Manager):
     pass
 }}}
 according to very quick testing this doesn't work similarly in master and
 after patch.

 It is likely possible to make mixins work with some mro introspection. I
 don't think the direct assignment case needs to be supported, it is likely
 extremely rare.

 Apart of the above cases I can't think of any case that will not work - as
 long as each class in the inheritance chain is subclass of Manager they
 will get both the get_queryset and get_query_set methods, and things will
 work. But, Python allows for some crazy constructs so I am not surprised
 if other problematic constructs are found.

 I am not sure if this kind of renaming is the best idea in the world. But,
 I don't care enough to actually put a -0 here (let alone -1). I guess we
 could do this renaming, and if we want to do other similar ones, then lets
 first wait for 1.6 and see how this one actually worked out. Of course, if
 something similar has been done already and it worked well, then put me
 into +0 camp.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/15363#comment:15>
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to