title: Getting error object has no attribute 'get' while using clean in django modelform
body: <p>I am trying to custom validate my model form. For the purpose, I wrote the following code:</p>
  
  <pre><code>class StudentForm(forms.ModelForm):
  
      class Meta:
          model = Student
          fields = '__all__'
  
      def clean(self):
  
          batch_start_year = self.cleaned_data.get('batch_start_year',None)
  </code></pre>
  
  <p>I am getting error like: </p>
  
  <pre><code>'StudentForm' object has no attribute 'get'
  </code></pre>
  
  <p>I tried another solution, but it didn't work either. </p>
  
  <pre><code>class StudentForm(forms.ModelForm):
  
      class Meta:
          model = Student
          fields = '__all__'
  
      def clean(self):
          cleaned_data = super(StudentForm, self).clean()
  
          batch_start_year = cleaned_data['batch_start_year']
  </code></pre>
  
  <p>Please help me to solve this.</p>
  
  <p>Full stack trace:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 149, in get_response
      response = self.process_exception_by_middleware(e, request)
    File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 147, in get_response
      response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File "/home/shahjahan/Desktop/jmialumniusa/jmialumniusa_app/views.py", line 18, in apply
      if form.is_valid():
    File "/usr/local/lib/python2.7/dist-packages/django/forms/forms.py", line 161, in is_valid
      return self.is_bound and not self.errors
    File "/usr/local/lib/python2.7/dist-packages/django/forms/forms.py", line 153, in errors
      self.full_clean()
    File "/usr/local/lib/python2.7/dist-packages/django/forms/forms.py", line 364, in full_clean
      self._post_clean()
    File "/usr/local/lib/python2.7/dist-packages/django/forms/models.py", line 377, in _post_clean
      exclude = self._get_validation_exclusions()
    File "/usr/local/lib/python2.7/dist-packages/django/forms/models.py", line 337, in _get_validation_exclusions
      field_value = self.cleaned_data.get(field)
  AttributeError: 'StudentForm' object has no attribute 'get'
  </code></pre>