【发布时间】:2011-10-17 01:19:53
【问题描述】:
我正在尝试在一个需要动态的循环中访问会话密钥,我想你会通过查看我的不工作的代码得到我想要的。
{% for q in questions %}
<div class="question_wrap">
<h2>{{ q }}</h2>
# this does not work
{% if not request.session.get(str(q.id), False) %}
<!-- show them vote options -->
{% else %}
<!-- dont show options -->
{% endif %}
</div>
{% endfor %}
【问题讨论】:
标签: python django templates session