开发者

Django template rendering to itself

I am trying to render the开发者_高级运维 dictionary content using Django template like this

for example : result contain dictionary X

X={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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜