<select id="{{ form.activity.auto_id }}" name="{{ form.activity.name }}" data-size="10">
{% for id, name in form.activity.field.choices %}
{% if form.activity.value == id %}
<option value="{{ id }}" selected>{{ name }}</option>
{% else %}
<option value="{{ id }}">{{ name }}</option>
{% endif %}
{% endfor %}
</select>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a6a2db7a-e4b0-4281-b6db-6f31009ac68d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You can remove that entire pasted section of code and replace it with {{ form.activity }}, Django will render it with the behavior you described.
-James
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei0cQOhZA1ae%3DVozqdL3uxERTpfinYRBx1CncGiu3Tepmw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1ec396fb-ff4b-43ea-8304-4a876bd56c35%40googlegroups.com.