Skip to content

Instantly share code, notes, and snippets.

@WBarton
Last active December 10, 2015 14:08
Show Gist options
  • Save WBarton/4445204 to your computer and use it in GitHub Desktop.
Save WBarton/4445204 to your computer and use it in GitHub Desktop.
Rough markup to render an easy to customise select tag from a Django form.
<select name="{{ field.auto_id }}" id="{{ field.auto_id }}">
{% for choice in form.my_choice_field.field.choices %}
<option value="{{ choice.0 }}">{{ choice.1 }}</option>
{% endfor %}
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment