I have a patch in the works if accepted.
--
We're building out a custom admin base for CleanerVersion in which we
subclass ModelAdmin. We needed to dynamically get the developer's choices
in exclude and add in our own without overwriting the developer's settings
in their concrete class. Just about all other attributes have their own
hook method in order to get at attribute values, but exclude seems to be
the only one that is doesn't follow this pattern.
It is possible to "mock" this without having to override bunch of other
methods by using a @property descriptor, but this causes the admin checks
to throw an error when performing the check on exclude. This is monkey
patched by subclassing the admin checks class and overriding the check for
exclude. Less than ideal.
Simple solution is add an get_exclude() method to the BaseModelAdmin so it
offers the same hook methods that are available for list_display, fields,
etc.
--
Ticket URL: <https://code.djangoproject.com/ticket/24941>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
[https://groups.google.com/d/topic/django-
developers/WrnhmTyLHuY/discussion thread on django-developers].
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:2>
* owner: nobody => SujaySKumar
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:3>
* has_patch: 0 => 1
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:4>
* owner: SujaySKumar => olasitarska
* has_patch: 1 => 0
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:5>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/5214 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:6>
* needs_better_patch: 0 => 1
Comment:
I left comments for improvement on the pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:7>
* cc: zborboa@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:8>
* owner: Ola Sitarska => Zach Borboa
* needs_better_patch: 1 => 0
Comment:
[https://github.com/django/django/pull/7252 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:9>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:10>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:11>
* needs_tests: 0 => 1
Comment:
As noted on the PR, tests for the `ModelAdmin.get_formsets()` changes are
missing.
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:12>
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:13>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"bf91be83d56d70181de807a5e8d22679cf63a52f" bf91be83]:
{{{
#!CommitTicketReference repository=""
revision="bf91be83d56d70181de807a5e8d22679cf63a52f"
Fixed #24941 -- Added ModelAdmin.get_exclude().
Thanks Ola Sitarska for the initial patch.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24941#comment:14>