Hi Carlton,
>
https://groups.google.com/d/topic/django-developers/-OWoYL_zryM/discussion
>
Yes, I've seen these too.
>
> I’ll have another review of it, but is there an **exact** change you
> have in mind that satisfies all the competing Wants? (It was all quite
> interconnected IIRC)
>
I think they're not all that interconnected. The change in #29917 was
about duplication caused by inheritance; #30311 is about duplication
between an admin's specific actions and the site-wide actions. I fully
endorse and support the inheritance change.
The change I'd like to see is a rewrite of _get_base_actions(), so that
instead of blindly adding the site-wide actions, it only adds those not
defined by the specific admin. There's lines there[1] that say:
for (name, func) in self.admin_site.actions:
description = getattr(func, 'short_description', name.replace('_', ' '))
actions.append((func, name, description))
[1]
https://github.com/django/django/blob/master/django/contrib/admin/options.py#L855
and I'd like to see added something along the lines of:
for (name, func) in self.admin_site.actions:
if name in (self.actions or []):
continue
description = getattr(func, 'short_description', name.replace('_', ' '))
actions.append((func, name, description))
(that's too simplistic, actions can given by more than name, but
that's the general idea)
This way, if an admin wants to override, they just do.
HTH,
Shai.