title: Django MultiWidget and field labels
body: <p>I have a requirement for a Django form that contains 3 <code>forms.Textarea</code> which are compressed into a single <code>models.TextField</code> compatible value. For this, I've subclassed both <code>forms.MultiValueField</code> and <code>forms.MultiWidget</code>. My problem is in trying to identify where and how to add labels to the widget's <code>textarea</code> inputs.</p>
  
  <p>What I am currently doing is passing in the label value as an <code>attr</code> to the widget's subwidgets:</p>
  
  <pre class="lang-python prettyprint-override"><code>class ContentWidget(forms.MultiWidget):
      template_name = 'content_widget.html'
  
      def __init__(self, attrs=None):
          widgets = (
              forms.Textarea({'label': 'A'}),
              forms.Textarea({'label': 'B'}),
              forms.Textarea({'label': 'C'}),
          )
          super().__init__(widgets, attrs)
  </code></pre>
  
  <p>This lets me keep the <code>content_widget.html</code> pretty concise:</p>
  
  <pre><code>{% for subwidget in widget.subwidgets %}
    &lt;label for="{{ subwidget.attrs.id }}"&gt;{{ subwidget.attrs.label }}&lt;/label&gt;
    {% include subwidget.template_name with widget=subwidget %}
    &lt;br /&gt;
  {% endfor %}
  </code></pre>
  
  <p>But this also adds the <code>label</code> attr to each html element, which feels a bit hacky:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;textarea name="content_0" cols="40" rows="10" label="A" required="" id="id_content_0"&gt;&lt;/textarea&gt;
  </code></pre>
  
  <p>Another option is to explicitly include it in a more long-form version of the template:</p>
  
  <pre><code>&lt;label for="{{ widget.subwidgets.0.attrs.id }}"&gt;A&lt;/label&gt;
  {% include widget.subwidgets.0.template_name with widget=subwidget %}
  ...
  </code></pre>
  
  <p>However, for form elements in general, the label is assigned to the <em>field</em>, but I can't find a way for the widget to access them from the <code>MultiValueField</code> instance if I define them there:</p>
  
  <pre class="lang-python prettyprint-override"><code>class ContentField(forms.MultiValueField):
      def __init__(self, **kwargs):
          fields = (
              forms.CharField(label="A"),
              forms.CharField(label="B"),
              forms.CharField(label="C"),
          )
          super().__init__(fields, require_all_fields=False, **kwargs)
  </code></pre>
  
  <p>My concern is both that this makes the code harder to maintain and that this indicates I've missed something obvious here. My question is if there's a more consistent approach.</p>