次のようなテーブルがあります。
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th>Project Name</th>
<th>Tape-ID</th>
<th>Video Type</th>
<th>Date Created</th>
<th>Director</th>
<th>Camera Person</th>
<th>Editor</th>
<th>Tag</th>
</tr>
</thead>
<tbody>
{% load endless %}
{% paginate 8 a %}
{% for choice, i in a %}
<tr>
<td><input type="checkbox" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" onchange="checkChecked()" /></td>
<td>{{ choice.name }}</td>
<td>{{ choice.tape_id }} </td>
<td>{{ choice.video_type }}</td>
<td>{{ i }}</td>
<td>{{ choice.director }}</td>
<td>{{ choice.cameraman }}</td>
<td>{{ choice.editor }}</td>
<td>{{ choice.tag1 }}, {{ choice.tag2 }}, {{ choice.tag3 }}, {{ choice.tag4 }},
{{ choice.tag5 }}, {{ choice.tag6 }}, {{ choice.tag7 }}, {{ choice.tag8 }},
{{ choice.tag9 }}, {{ choice.tag10 }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
これらの変数{{ choice...}}
には、値がある場合とない場合があります。シーケンシャルですが。3 つまでの変数は値を持つことができ、3 より後の値を持つことはできません。値がない場合は、次のようになります。
water, pollution, hello, , , , , ,
値がない場合はコンマを表示したくありません。これどうやってするの?