title: django - how to process/clean a field before validation
body: <p>I have a form that needs to be validated only after it has been cleaned.</p>
  
  <p>What happens when you run <code>form.is_valid()</code> ? Is the form cleaned and then that cleaned version of the form validated?</p>
  
  <p>The behaviour I'm getting at the moment, is that if my field does not pass validation before cleaning, even if cleaning would make it pass, <code>is_valid()</code> returns <code>False</code>.</p>
  
  <p>Am I doing something wrong?</p>
  
  <h2>Code:</h2>
  
  <pre><code># View
  class ContactForm(forms.Form):
      message = forms.CharField(widget=forms.Textarea, max_length=5)
  
      def clean_message(self):
          message = self.cleaned_data['message']
          return message.replace('a', '') # remove all "a"s from message
  
  def contact(request):
      if request.method == 'POST':
          if form.is_valid():
              return HttpResponseRedirect('/contact/on_success/')
          else:
              return HttpResponseRedirect('/contact/on_failure/')
  </code></pre>
  
  <p>I want <code>form.is_valid()</code> to return <code>True</code> if the message has less than 5 characters <strong>NOT</strong> including <code>a</code>!</p>
  
  <p>Is it possible to run <code>clean_&lt;fieldname&gt;()</code> after <code>to_python()</code> but before <code>run_validators()</code>? Or should I be doing this some other way?</p>