#20932: Issues with model Manager and inheritance.
-------------------------------------+-------------------------------------
     Reporter:  loic84               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by loic):

 Just to clarify the nature of the backwards incompatibility:

 {{{
 class BachelorParty(Model):
     events = CustomManager()

 class MessyBachelorParty(BachelorParty):
     pass
 }}}

 `MessyBachelorParty.objects` wouldn't exist anymore, and
 `MessyBachelorParty._default_manager` would be an instance of
 `CustomManager`.

 {{{
 class BachelorParty(Model):
     objects = CustomManager()

 class MessyBachelorParty(BachelorParty):
     pass
 }}}

 `MessyBachelorParty.objects` would become an instance of `CustomManager`
 instead of just `models.Manager`.

--
Ticket URL: <https://code.djangoproject.com/ticket/20932#comment:13>
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/064.01a03f7a263211501da4b52a6f69337b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to