#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):
I really like the idea of having `Model.objects = models.Manager()` and
let the MRO do its thing. By itself, it wouldn't be that far reaching (I
don't think anyone would have reasons to check for its absence)
The problematic bit would be getting rid of `_default_manager` because
people that added an explicit custom manager named anything but `objects`
would now see their default manager downgraded to the inherited
`models.Manager`.
Unless we apply the same ~~magic~~ logic that currently overrides
`_default_manager` to override an inherited `objects`, but then we can't
say that normal MRO resolution applies.
--
Ticket URL: <https://code.djangoproject.com/ticket/20932#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 [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.bca0c9c2c8ebb83a89119c946a4eb08f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.