[Answered ]-Checking boxes for items passed through context in Django

2👍

Why not do it in the template language?

<input type="checkbox" {% if node.id in selected_ids %} checked="checked"{% endif %} id="{{ node.id }}" value="{{ node.id }}" name="category"/>

Leave a comment