title: Help with Admin forms validation error
body: <p>I am quite new to Django, I'm having few problems with validation
  forms in Admin module, more specifically with raising exceptions in the
  ModelForm. I can validate and manipulate data in clean methods but
  cannot seem to raise any errors. Whenever I include any raise
  statement I get this error &quot;'NoneType' object has no attribute
  'ValidationError'&quot;. When I remove the raise part everything works
  fine.</p>
  <p>Then if I reimport django.forms (inside clean method) with a different alias (e.g. from django import forms as blahbalh) then I'm able to raise messages using blahblah.ValidateException.</p>
  <p>Any tips or suggestions on doing such a thing properly ?</p>
  <p>Here's an example of what I'm doing in Admin.py:</p>
  <h3>admin.py</h3>
  <p>from django import forms
  from proj.models import *
  from django.contrib import admin</p>
  <p>class FontAdminForm(forms.ModelForm):</p>
  <pre><code>class Meta:
  
      model = Font
  
  def clean_name(self):
  
      return self.cleaned_data[&quot;name&quot;].upper()
  
  def clean_description(self):
  
      desc = self.cleaned_data['description']
      if desc and if len(desc) &lt; 10:
          raise forms.ValidationError('Description is too short.')
      return desc
  </code></pre>
  <p>class FontAdmin(admin.ModelAdmin):</p>
  <pre><code>form = FontAdminForm
  list_display = ['name', 'description']
  </code></pre>
  <p>admin.site.register(Font, FontAdmin)</p>
  <p>--
  Thanks,
  A</p>