[Fixed]-Django template keyword `choice_value` in no longer work in 1.11

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

Leave a comment