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. Template tag - list punctuation for a list of items by shapiromatron 3 months, 1 week ago
  2. JSONRequestMiddleware adds a .json() method to your HttpRequests by cdcarter 3 months, 2 weeks ago
  3. Serializer factory with Django Rest Framework by julio 10 months, 1 week ago
  4. Image compression before saving the new model / work with JPG, PNG by Schleidens 11 months ago
  5. Help text hyperlinks by sa2812 11 months, 3 weeks ago

Comments

Please login first before commenting.