TemplateSyntaxError在if表达式的末尾未使用

时间:2014-06-23 06:46:25

标签: python django if-statement boolean

Django 1.6。我收到以下错误:

Exception Type: TemplateSyntaxError at /docprofile/5/
Exception Value: Unused 'c.user_id' at end of if expression.

在线:

{% if c.user_id == like.user_id and c.doctor_id == like.doctor_id %}

我有以下代码:

 {% for c in UGC %}

  {% if c.doctor_id == doctor.id  %}
  <div class="cmts">

    <h4>{{c.comment}}</h4>
    <h4>{{c.user_id}}</h4>
    <p>Waited less than {{c.time}} mins</p>
    <p class="timestamp">{{c.submitted_on}}</p>

  </div>

    {% if c.user_id == like.user_id and c.doctor_id == like.doctor_id %}
       <img class="thumbs" src="/static/meddy1/images/thumbsup.png">

    {% elif if c.user_id == dislike.user_id and c.doctor_id == dislike.doctor_id %}
       <img class="thumbs" src="/static/meddy1/images/thumbsdown.png">
    {% endif %} 

  {% endif %}

  {% endfor %}`enter code here`

if语句结束时未使用的含义是什么?

0 个答案:

没有答案