Sometimes you want to dump the attr names of a variable so that you can remember what is in there. This isn't the best way in the world and could be improved upon but it's a start. See http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ for more
The simple inclusion template tag:
from django import template
register = template.Library()
@register.inclusion_tag('portal/ttags/show_object.html')
def show_object(obj):
attrs = [ x for x in dir(obj) if not x.startswith('_') ]
return {'obj': obj, 'd': attrs,}
Then, in the template:
{% include mytags %}
{% show_object myobject %}
oh yeah, and show_object.html:
<h4>Showing attributes for {{ obj }}</h4>
{{ d }}