deep = 0;
list = []
def rec(n)
deep = deep+1
list.append((deep,n))
for nn in Node.objects.filter(parent = n):
rec(nn)
deep = deep-1
rec(root)
{% for deep, n in list %}
<p style="left-margin:{{deep}}px">{{n}}</p>
{% endfor %}
deep = 0;
list = []
def rec(n)
deep = deep+1
list.append((deep,n))
for nn in Node.objects.filter(parent = n):
rec(nn)
deep = deep-1
rec(root)
{% for deep, n in list %}
<p style="left-margin:{{deep}}px">{{n}}</p>
{% endfor %}