Hello fellow Djangonauts,

While working on upgrading a project to 2.2, I ran into multiple
instances of 

        <class '...Admin'>: (admin.E130) __name__ attributes of actions
        defined in <class '...Admin'> must be unique.

caused by the fact that, out of a large set of Admin classes, about a
dozen have defined their own version of the 'delete_selected' action.

When looking into it, I came across ticket #30311[1] which basically
complained about the very same thing; but was closed as invalid,
under the claim that the user is in full control of both the site-wide
actions and the admin-specific actions, and so can do whatever they
like.

While that claim is certainly correct, I would like to suggest that it
creates an odd situation for the app which wants to define its own
version of delete_selected (or any other site-wide-availabe action) for
one of its models. In fact, it now cannot be done at the app level --
it requires that the default action be disabled at the site level.

If (as is probably the case with delete_selected) it is still desired
as a site-wide-available action, then the default needs to be replaced
with a custom action which first looks for an override on the specific
admin, and if not found invokes the original. And that seems to me like
a hoop we shouldn't force people to jump through.

Opinions?

[1] https://code.djangoproject.com/ticket/30311

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/20200318180034.15cff442.shai%40platonix.com.

Reply via email to