#26652: Model instance no longer has a _default_manager attribute
--------------------------------------+------------------------------------
Reporter: rsalmaso | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by loic):
* component: Database layer (models, ORM) => Documentation
* needs_docs: 0 => 1
* type: Uncategorized => Cleanup/optimization
* easy: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Managers were never intended to be accessible on model instances, we even
[https://github.com/django/django/blob/30d110ef43d8a3c50ea8ec4e4fe49bd2bb859530/django/db/models/manager.py#L186
use a descriptor to prevent that usage] but `_default_manager` somehow
escaped that restriction. I guess we can mention the change in the release
notes.
For completeness I'll mention that if we really wanted these available on
the instance we could just move the properties from `ModelBase` to
`models.Model`, but I don't think we should.
--
Ticket URL: <https://code.djangoproject.com/ticket/26652#comment:3>
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/066.b5af9fab729b35142ccc8d5e11dfc0dc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.