2
問題是什麼?它說我無效的塊標籤:'endfor'。Django標記錯誤。無效的塊標記:'endfor'
{%else%}
<ol id="sortable" name="plst{{first_list.pk}}">
{% for item in playlist %}
<li id="item{{item.pk}}" media="{{item.media.pk}}" class="holderPlace" title="{{item.media.name}}"><span> {{item.media.name|custom_slice:30}} </span>
{%ifequal item.media.watch_status 0 %}
<img src="{{MEDIA_URL}}images/content_started_watch_12x12.gif" title="ddd" alt="" height="12" width="12" style="position:relative;top:2px;"/>
{%else%}
{%ifequal item.media.watch_status 1 %}
<img src="{{MEDIA_URL}}images/content_watched_12x12.gif" title="Вы уже смотрели эту передачу" alt="" height="12" width="12" style="position:relative;top:2px;"/>
{%endifequal%}
<div class="buttons"> <a href="javascript:void(0);" class="myButtonPlay" title="Начать просмотр"><img class="button_play" src="{{MEDIA_URL}}images/playlist/btn_play.gif" width="80" height="28" /></a><span>{{item.media.duration}} мин.</span> <a href="javascript:void(0);" class="deleteButton" title="Удалить из плейлиста"><img src="{{MEDIA_URL}}images/playlist/btn_delete.gif" width="29" height="22" /></a> <a href="javascript:void(0);" class="myButtonDown" title="Переместить вниз"><img src="{{MEDIA_URL}}images/playlist/btn_down.gif" width="29" height="22" /></a> <a href="javascript:void(0);" class="myButtonUp" title="Переместить вверх"><img src="{{MEDIA_URL}}images/playlist/btn_up.gif" width="29" height="22" /></a></div>
</li>
{% endfor %}
</ol>
{%endif%}
Django抱怨,因爲它認爲它到達endfor時仍然處於ifequal塊之一內。 – Amos 2010-10-21 17:57:40
+1說明 – frnhr 2011-03-15 14:26:31