views:

57

answers:

1

I'd like to build a custom admin action into a model defined by Django. Let's say I wanted to add the action "Activate selected User(s)" on django.contrib.auth.models.User in the Django admin interface. What would be the clean and proper way to accomplish this?

I had a look at the documentation but it's just about implementing admin actions in custom models if I looked correctly.

+3  A: 
admin.site.unregister(User)
admin.site.register(User, YourUserAdmin)
PiotrLegnica
thanks for clearing this up! is there a way I could have gotten hold of this information by myself? I searched the docs for `unregister` but found nothing.
Jannis
Best way is to read the source (`django.contrib.admin.sites` in this case). I don't know how official or stable it is, though (but it's kind of logical to have `unregister` when there's `register`).
PiotrLegnica