Django template rendering to itself
I am trying to render the开发者_高级运维 dictionary content using Django template like this
for example : result contain dictionary XX={a:1,
b:1,
c:X(dictionary X again)
}
This could be any many places and at multiple levels
template : results.html, says something like following
{{a}}
{{b}}
{% if X.a %}
{% include results.html %}
{% endif %}
I thought that this would work but I get error saying
maximum recursion depth exceeded while calling a Python object
How could I resolve this?
Thank you
get rid of the c:X part in your dictionary X, you can't do that.
You can use X or properties included in it twice in your template, so there's no need for nested self-references in your dictionary.
精彩评论