title: How do I iterate over the options of a SelectField in a template?
body: <p>I have a select field in the form and now I need to iterate over options in this field.</p>
  
  <p><code>{{ form.myselect }}</code> gives me this:</p>
  
  <pre><code>&lt;select name="myselect" id="id_myselect"&gt;
      &lt;option value="" selected="selected"&gt;---------&lt;/option&gt;
      &lt;option value="2"&gt;Item 1&lt;/option&gt;
      &lt;option value="3"&gt;Item 2&lt;/option&gt;
      ...
  &lt;/select&gt;
  </code></pre>
  
  <p>Now I need to add some attributes to the options and because of that what I need is:</p>
  
  <pre><code>&lt;select name="myselect" id="id_myselect"&gt;
  {% for x in form.myselect %}
      &lt;option value="{{ x.id }}"&gt;{{ x.name }}&lt;/option&gt;
  {% endfor %}
  &lt;/select&gt;
  </code></pre>
  
  <p>but there is an error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Caught TypeError while rendering: 'BoundField' object is not iterable
  </code></pre>
  
  <p>I tried <code>form.myselect.all</code>, <code>form.myselect.option_set</code> but it gives nothing</p>