[Answered ]-How to populate checkboxes in a table with values from a Django model

1👍

you don’t need a js function to render existing data with the Checked/Unchecked Box.

assuming boolean field name is_subscribed

{% for sub in subscribers %}
   {% if sub.is_subscribed %}
     <input type="checkbox" checked>
   {% else %}
     <input type="checkbox">
   {% endif %}
{% endfor %}

but Yes you gonna need js click event if you want it to update using the Click on Realtime without Refreshing page

Leave a comment