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

Тел: +7 965 3737 888

434

Просмотров

0

Ответов

Simple Admin-button linking to Databrowse

<p>If you want all the objects in your models' admin interface  to have a direct link to their databrowse page (just like the <em>history</em> link).. follow these steps: </p>
<p>1) copy the <em>change_form.html</em> admin template in mytemplates/admin/</p>
<p>2) edit <em>change_form.html</em> by adding this code  right next to (before or after) the following line (=the history button markup):</p>
<p>&lt;li&gt;&lt;a href="history/" class="historylink"&gt;History&lt;/a&gt;&lt;/li&gt;</p>
<p>3) Make sure that all of you models are registered with <a href="http://docs.djangoproject.com/en/dev/ref/contrib/databrowse/">databrowse</a> </p>
<p>That's it. Obviously if you don't want ALL the models to have this link, you should use a different recipe, for example this one: <a href="http://docs.djangoproject.com/en/dev/ref/contrib/databrowse/">http://www.djangosnippets.org/snippets/1016/</a></p>

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