#32640: Non-manager instance assigned to model class' objects is silently
ignored
-------------------------------------+-------------------------------------
Reporter: Shai Berger | Owner: Shai
| Berger
Type: Bug | Status: assigned
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):
* needs_better_patch: 0 => 1
Comment:
OK, after
[https://github.com/django/django/pull/14260#pullrequestreview-742687431
looking at the PR], I'm going to mark this as Patch needs improvement
again. (It may be we uncheck as the discussion on the PR continues.)
In summary, two main points from the review:
* The proposal to `add_to_class()` effects all passes through that, rather
than just those where an attribute is added late, and may override an
existing attribute. Making the change means we end with different error
paths for the case on the concrete instance vs inheritance, and the
existing system checks for that seem more tightly targeted for that.
* A specific error raised at the point where the default objects manager
is added would be able to offer a much better error message, whilst
avoiding the above. (A subsidiary System Check could alert to
`extra_manager` cases.)
--
Ticket URL: <https://code.djangoproject.com/ticket/32640#comment:9>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/063.6d4e775dab335982d4b8445e3570b69c%40djangoproject.com.