views:

35

answers:

2

I am overriding the admin fieldset.html template? I need to access the model. I have a table called domain and I need to query the database (Domain.objects.all) get a list of all the domains and pass it to the template. How/where would I do it especially with respect to admin interface. Thanks

A: 

I find making a template tag usually works in this situation. In the template you are writing, you can usually make a tag, call it something like 'get_domains' that functions like this:

{% load mylibrary %}

{% get_domains as domains %}

{% for domain in domains.all %}
   {{ domain.name }}
{% endfor %}
Collin Anderson
A: 

Documentation for overriding the view:

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#other-methods

Collin Anderson