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. Treat empty value on DateRangeFilter as a filter for non filled dates by kmmbvnr 1 month ago
  2. Django Settings Assignment Expressions aka Walrus Operator example by webology 2 months, 1 week ago
  3. codigo alto nivel by MrRocklion 4 months ago
  4. Load template from specific app by Krzysiek555 4 months, 3 weeks ago
  5. PostgreSQL JSON subqueries by dolamroth 4 months, 3 weeks ago

Comments

Please login first before commenting.