title: ValidationError in Django
body: <p>Hi I am very new at Django. I am working on a small project in which i am using modelform.
  For date field i want to do custom validation i.e. whenever a user enter a date before today's date it should display a error message near date field. I have written code as per the django's documentation, but it gives ValidationErrors for the raise statement in modelform. like 
  ValidationError at /add_task/
  [u"Please enter valid date. Either today's date or after that."]</p>
  
  <p>Please help me how to overcome this problem. Thanks in advance.</p>
  
  <p><strong>Codes of my models:</strong></p>
  
  <pre><code>from django.db import models
  
  class MyTask(models.Model):
  
      summary=models.CharField(max_length=100)
  
      description=models.CharField(max_length=500)
  
      due_date=models.DateField(null=True)
  
      completed_status=models.BooleanField()
  
      def __unicode__(self):
          return self.summary
  </code></pre>
  
  <p><strong>Codes of my modelform:</strong></p>
  
  <pre><code>from django.forms import ModelForm, Textarea
  
  from django.forms.extras.widgets import SelectDateWidget
  
  from django.core.exceptions import ValidationError
  
  from assignment.models import MyTask
  
  import datetime
  
  class AddTaskForm(ModelForm):
  
      class Meta:
  
          model=MyTask
  
          fields=('summary','description','due_date')
  
          widgets = {
              'description': Textarea(attrs={'cols': 50, 'rows': 10}),
              'due_date':SelectDateWidget(),
          }
  
      def get_due_date(self):
  
          diff=self.cleaned_data['due_date']-datetime.date.today()
  
          if diff.days&lt;0:
  
              raise ValidationError("Please enter valid date. Either today's date or after that.")
  
      else:
  
              return self.cleaned_data['due_date']    
  
      def get_summary(self):
  
              return self.cleaned_data['summary']
  
      def get_description(self):
  
              return self.cleaned_data['description']
  </code></pre>