title: Django custom validation of multiple fields
body: <p>for which I want to validate a number of fields in a custom clean method.</p>
  
  <p>I have this so far:</p>
  
  <pre><code>class ProjectInfoForm(forms.Form):
      module = forms.ModelChoiceField(
          queryset=Module.objects.all(),
      )
      piece = forms.CharField(
          widget=forms.Select(),
          required=False,
      )
      span = forms.IntegerField(
          max_value=100,
          initial=48
      )
      max_span = forms.IntegerField(
          max_value=100,
          initial=0
      )
  
  
      def clean(self):
          span = self.cleaned_data['span']
          max_span = self.cleaned_data['max_span']
          piece = self.cleaned_data.['piece']
  
          # validate piece 
          try:
              Piece.objects.get(pk=m)
          except Piece.DoesNotExist:
              raise forms.ValidationError(
                  'Illegal Piece selected!'
              )
              self._errors["piece"] = "Please enter a valid model"
  
          # validate spans
          if span &gt; max_span:
              raise forms.ValidationError(
                  'Span must be less than or equal to Maximum Span'
              )
              self._errors["span"] = "Please enter a valid span"
          return self.cleaned_data
  </code></pre>
  
  <p>However, this only gives me one of the messages if both clauses invalidate. How can I get all the invalid messages. Also I do not get the field-specific messages - how do I include a message to be displayed for the specific field?</p>
  
  <p>Any help much appreciated.</p>