我在 ModelForm 中有多项选择。当页面重新加载出现错误时,我希望显示当前选定的项目。
视图.html
error: {{ form.recipients.errors }}<br/>
currently selected: <br/>
{% for recipient in form.recipients %} <!--I want some type of loop through only the selected items in my recipients -->
{{ recipient }}<br/>
{% endfor %}
{{ form.recipients }}