2👍
✅
In this case you should be able to say:
{% for e_field in exercise_all %}
<table>
<tr><th>Header</th></tr>
{% for s_field in e_field.subject_set.all %}
<tr><td>{{ e_field.name_e }}</td></tr>
{% endfor %}
</table>
{% endfor %}
Source:stackexchange.com