Задать вопрос

Тел: +7 965 3737 888

526

Просмотров

1

Ответов

Adding buttons to submit line in a Admin page

<p><strong>Attention: this snippet depends on jQuery library to works</strong>
</p>
<p>The Admin templates hierarchy does not allow you change the submit line (that buttons bar in the footer of the change view of a model class).
</p>
<p>This code shows how to resolve this, using a simple javascript trick. You can read the code and implement using your favorite javascript library (instead of jQuery) or pure JavaScript.
</p>
<p>This example regards to User Profile, a common used model class that adds custom fields to a user in the authentication system.
</p>
<p>To use this, you must put this template code in a file with the following name:
</p>
templates/admin/auth/user/change_form.html

Вопрос полезен? Да0/Нет0
file_2808.py(578.0б)
None

Ответы (1):

Ответitavor:14.05.2008
Ответ полезен? Да0/Нет0

Nice! I already include jQuery in admin for most of my sites and use it to do other customizations, this is very easy to add and very useful.