Login

Simple Admin-button linking to Databrowse

Author:
magicrebirth
Posted:
April 28, 2009
Language:
Python
Version:
1.0
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. Add custom fields to the built-in Group model by jmoppel 1 month, 1 week ago
  2. Month / Year SelectDateWidget based on django SelectDateWidget by pierreben 4 months, 3 weeks ago
  3. Python Django CRUD Example Tutorial by tuts_station 5 months, 1 week ago
  4. Browser-native date input field by kytta 6 months, 3 weeks ago
  5. Generate and render HTML Table by LLyaudet 7 months ago

Comments

Please login first before commenting.