#11715: If change mutable list "inlines" in one admin options then it will
change
"inlines" for all admin options.
-------------------------------------+-------------------------------------
Reporter: Alexander Ivanov | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.1
Severity: Normal | Resolution:
Keywords: inlines admin | Triage Stage: Accepted
options |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):
* owner: nobody => Jacob Walls
* needs_better_patch: 1 => 0
* status: new => assigned
* type: Bug => Cleanup/optimization
Comment:
This issue predates the system check framework. Trying the original
example (I created a new class in the `admin_inlines` test suite) now
catches errors before failing at the db layer:
{{{
<class 'admin_inlines.admin.FootNoteAuditInline'>: (admin.E202)
'admin_inlines.FootNoteAudit' has no ForeignKey to
'admin_inlines.ShowInlineParent'.
}}}
> What exactly is the issue with the current implementation?
I think if there is one, it's that folks might believe they can mutate the
`inlines` on ''instances'' of `ModelAdmin`, but that's user error if
they're not willing to accept it applying to all model admins.
[https://github.com/django/django/pull/15270 PR] clarifies the intended
immutability of the `inlines` attribute of `ModelAdmin` by defaulting to
`()`, but we could also just close as user error.
--
Ticket URL: <https://code.djangoproject.com/ticket/11715#comment:5>
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/061.b233d63776c042b4a1488ca80540d718%40djangoproject.com.