22👍
✅
As @L_S ‘s comments. I debug with dir(form)
, all value contained in form.project.data
here’s the correct code:
{% for choice in form.project %}
<labelc for="{{ choice.id_for_label }}">
<input type="checkbox" name="{{ choice.data.name }}" id="{{ choice.id_for_label }}"
value="{{ choice.data.value }}"{% if choice.data.selected %} checked{% endif %}>
{{ choice.data.label }}
</label>
{% endfor %}
👤fen
Source:stackexchange.com