how can I filter the groups based on the user in Django-template-language with if else condition
<tbody>
{% for group in groups %}
<tr>
<td>{{group.name}}</td>
<td><input type="checkbox" name="add_group[]" id="group-{{group.id}}" value="
{{group.id}}"
checked
></td>
</tr>
{% endfor %}
</tbody>

You can access an
Usergroup with related object reference or in DTL with a dot notation:User.groups.all.For instance, if you want
checkedonly in groups that a specific user is in:urls.py:
views.py
user_group.html