I have a tree structure in memory that I would like to render in HTML using a Django template.
class Node():
name = "node name"
children = []
There will be some object root
that is a Node
, and children
is a list of Node
s. root
will be passed in the content of the template.
I have found this one discussion of how this might be achieved, but the poster suggests this might not be good in a production environment.
Does anybody know of a better way?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…