我的模板中有以下逻辑:
{% for task in tasks %}
{% ifchanged task.shared_task_id %}
<tr>{{ task }}</tr>
{% endifchanged %}
{% endfor %}
但是,如果是无,我想忽略ifchanged
标签。shared_task_id
就像是:
{% ifchanged task.shared_task_id or if task.shared_task_id == None %}
<tr>{{ task }}</tr>
{% endifchanged %}
有没有办法做到这一点?