title: Access form field attributes in templated Django
body: <p>I've been doing some custom forms with django but I don't get how to access attributes that a specific form field has attached via the forms.py.</p>
  
  <pre><code>def putErrorInTitle (cls):
  init = cls.__init__
  
  def __init__ (self, *args, **kwargs):
      init(self, *args, **kwargs)
      if self.errors:
          for field_error in self.errors:
              self.fields[field_error].widget.attrs['title'] = self.errors[field_error][0]
              self.fields[field_error].widget.attrs['class'] = "help_text error_field"
  
  cls.__init__ = __init__
  return cls
  </code></pre>
  
  <p>That's how I attached the attibutes to the field.</p>
  
  <pre><code>&lt;dl class="clearfix two"&gt;
   &lt;dd&gt;
    &lt;label for="id_diagnosis"&gt;Diagnostico:&lt;/label&gt;
     &lt;select class="{{form.id_diagnosis.class}}" id="id_equipment_activity-{{ forloop.counter0 }}-id_diagnosis" name="equipment_activity-{{ forloop.counter0 }}-id_diagnosis"&gt;
      {% for x,y in form.fields.id_diagnosis.choices %}
      &lt;option value="{{ x }}" {% ifequal form.id_diagnosis.data|floatformat x|floatformat %}selected="selected"{% endifequal %}&gt;{{ y }}&lt;/option&gt;
      {% endfor %}
      &lt;option value="1000" {% ifequal form.id_diagnosis.data|floatformat '1000'|floatformat %}selected="selected"{% endifequal %}&gt;Otro&lt;/option&gt;
     &lt;/select&gt;
   &lt;/dd&gt;
   &lt;dd class="vertical_center" id="optional_diagnosis"&gt;&lt;label for="optional_diagnosis"&gt;Diagnostico opcional:&lt;/label&gt;{{ form.optional_diagnosis }}&lt;/dd&gt;
  &lt;/dl&gt;
  </code></pre>
  
  <p>I've been trying to access its attributes:</p>
  
  <pre><code>class="{{form.id_diagnosis.class}}", class="{{form.id_diagnosis.widget.class}}"
  </code></pre>
  
  <p>And I don't seem to find clear documentation about what's accessible and what's not. Really I would rather have old fashion documentation than django "friendly" one</p>