Hi,
let me start by expressing my gratitude for your efforts into this nice project !
When actions are related to a certain field, it makes sense to have their button rendered within that field.
See for instance:
("Mot de passe" meaning "Password" in French).
I've managed to make the "Reset password" button appear in the password field by dedicating the help_text to it:
class UserChangeForm(admin_forms.UserChangeForm):
class Meta(admin_forms.UserChangeForm.Meta):
model = User
def __init__(self, **kwargs):
super().__init__(**kwargs)
password = self.fields.get('password')
if password:
password.help_text = \
"""<ul class="object-tools"><li class="objectaction-item" data-tool-name="reset_password">
<a href="/admin/users/guest/3/actions/reset_password/" title="" class="">Reset password</a>
</li></ul>
"""
Very hacky, but it hopefully provides you with a useful starting point for implementing this feature, would you consider it.
Hi, let me start by expressing my gratitude for your efforts into this nice project !
When actions are related to a certain field, it makes sense to have their button rendered within that field. See for instance: ("Mot de passe" meaning "Password" in French).
I've managed to make the "Reset password" button appear in the
password field
by dedicating thehelp_text
to it:Very hacky, but it hopefully provides you with a useful starting point for implementing this feature, would you consider it.
Cheers