I have a template that looks like:
<form method="post" action="{% url ... %}">
{% csrf_token %}
<table class="table">
{% for x in X %}
<tr>
<td>{{ x.name }}</td>
<td><input type="checkbox" value="{{x.id}}"" /></td>
</tr>
{% endfor %}
</table>
</form>
What type of field should I use in the django form class for the checkboxes ?
Thanks for the answers
EDIT:
I did not mention, X in loop is given at runtime. It is not a list of predefined values.
You need to specify
CheckBoxMultipleSelectwidget for the form field.E.g.
Reference: Widgets