Created
April 6, 2020 05:20
-
-
Save sanjaykrishnan/c98b6112793e3011695d8f729fbcf759 to your computer and use it in GitHub Desktop.
Implementing checkbox for many to many fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for widget in form.field_name %} | |
<tr> | |
<th> | |
<label for="{{widget.id_for_label}}"> | |
<input type="{{widget.data['type']}}" name="{{widget.data['name']}}" value="{{widget.data['value']}}" {% if widget.data['selected'] %}selected{% endif %} {% for k, v in widget.data['attrs'].items() %} {{k}}="{{v}}" {% endfor %}> | |
</label> | |
</th> | |
<td> | |
{{widget.choice_label}} | |
</td> | |
</tr> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment