title: How can I add custom properties to a field class for output in template?
body: <p>I would like to add a custom field which can provide additional properties for handling the individual output of in a template. For instance here's my class:</p>
  
  <pre><code>class CustomField(CharField):
      suffix = "things"
  </code></pre>
  
  <p>And my accompanying <code>field.html</code> where I've added the <code>field.suffix</code> block:</p>
  
  <pre><code>&lt;div class="controlGroup clearfix {% if field.errors %}error{% endif %}"&gt;
     &lt;label class="controlLabel" for="{{ field.auto_id }}"&gt;{{ field.label }}&lt;/label&gt;
     &lt;div class="controls"&gt;
         {{ field }}
         {% if field.suffix %}
             &lt;span class="suffix"&gt;{{ field.suffix }}&lt;/span&gt;
         {% endif %}
         {% if field.errors %}
             &lt;span class="helpInline"&gt;{{ field.errors }}&lt;/span&gt;
         {% endif %}
     &lt;/div&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>Unfortunately the suffix block simply doesn't output.</p>
  
  <p>EDIT: To clarify, both current answers below are targeted at adding widget attributes. I'm actually trying to add a custom string for use in the template, not a custom CSS class.</p>