title: Django form: set CSS class for list of choices
body: <p>I have a modelform in Django with a field <code>answer</code> represented by check boxes. I want to be able to identify the list of choices by a CSS class. Currently, I have modified the <code>__init__</code> method for the form and set the <code>class</code> attribute for the widget.</p>
  
  <pre><code>class CheckboxForm(forms.ModelForm):
      def __init__(self, *args, **kwargs):
          super(CheckboxForm, self).__init__(*args, **kwargs)
          self.fields['answer'] = forms.ModelMultipleChoiceField(
              widget=forms.CheckboxSelectMultiple(attrs={
                  'class': 'checkbox-a',
              }),
          )
      # ...
  </code></pre>
  
  <p>However, this sets the class for each of the individual checkbox inputs, like this:</p>
  
  <pre><code>&lt;ul id="id_answer"&gt;
      &lt;li&gt;&lt;label for="id_answer_0"&gt;
          &lt;input class="checkbox-a" type="checkbox"&gt;
      &lt;/label&gt;&lt;/li&gt;
      &lt;li&gt;&lt;label for="id_answer_1"&gt;
          &lt;input class="checkbox-a" type="checkbox"&gt;
      &lt;/label&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Instead, I want to set the class the <code>ul</code> of inputs, like this:</p>
  
  <pre><code>&lt;ul id="id_answer" class="checkbox-a"&gt;
      &lt;li&gt;&lt;label for="id_answer_0"&gt;
          &lt;input type="checkbox"&gt;
      &lt;/label&gt;&lt;/li&gt;
      &lt;li&gt;&lt;label for="id_answer_1"&gt;
          &lt;input type="checkbox"&gt;
      &lt;/label&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Is there any way to do that? I'm open to using jQuery/JavaScript, though having some way to put it in the form/model would be ideal.</p>
  
  <p><strong>Note:</strong> I can't base it just use the <code>id_answer</code> instead of a class because there are actually multiple forms on the page using prefixes and I want this to be able to apply to all of them.</p>