title: Override ModelForm is_valid function
body: <p>I want to provide my forms with nicer feedback using CSS. I'm already doing it but it's just a clean code matter. I have many <code>ModelForms</code> and I want all of them to behave in the same way, so I thought there should be a way to avoid duplicating code for validation.</p>
  
  <p>I have created a new class which overrides <code>ModelForm</code></p>
  
  <pre><code>class ModelFormCSS(forms.ModelForm):
      def is_valid(self):
          # run the parent validation first
          valid = super(--&gt;ParentModelForm&lt;--, self).is_valid()
  
          if not valid:
              for f_name in self.errors:
                  classes = self.fields[f_name].widget.attrs.get('class', '')
                  if not "errors" in classes:
                      classes += ' errors'
                      self.fields[f_name].widget.attrs['class'] = classes
              return valid
  
          # all good
          return True
  </code></pre>
  
  <p>My problem lies in runing the parent validation since I don't know how to get the parent form... isn't there any way to get it from <code>self</code>?</p>