Login

Simple Admin-button linking to Databrowse

Author:
magicrebirth
Posted:
April 28, 2009
Language:
Python
Version:
1.0
Tags:
django admin databrowse button
Score:
0 (after 0 ratings)

If you want all the objects in your models' admin interface to have a direct link to their databrowse page (just like the history link).. follow these steps:

1) copy the change_form.html admin template in mytemplates/admin/

2) edit change_form.html by adding this code right next to (before or after) the following line (=the history button markup):

<li><a href="history/" class="historylink">History</a></li>

3) Make sure that all of you models are registered with databrowse

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: http://www.djangosnippets.org/snippets/1016/

1
2
3
	{# applies to ALL models#}
	<li><a href="/databrowse/{{ opts.app_label }}/{{ opts.module_name}}/objects/{{ object_id }}" class="historylink">View in Databrowse</a></li>
	{# end of databrowse link #}

More like this

  1. Confirm alert if the user navigates away without saving changes by mrazzari 5 years, 8 months ago
  2. Class Feeds DRY TemplateTag by gmandx 4 years, 10 months ago
  3. Export Related as JSON Admin Action by johnboxall 5 years, 9 months ago
  4. Filter by taggit tags in the admin (Django 1.4) by albertorcf 2 years, 6 months ago
  5. Make hyperlinks for labels of raw_id_fields (jQuery) by ramen 5 years, 2 months ago

Comments

Please login first before commenting.