title: Django form validation : TypeError at /student/home conversion from dict to Decimal is not supported
body: <p>I have a decimalfield in my model</p>
  
  <pre><code>current_CGPA = models.DecimalField(blank=True,null=True,decimal_places=2,max_digits=4)
  </code></pre>
  
  <p>I am using Modelform to validate my form</p>
  
  <pre><code>class StudentAcademicsForm(ModelForm):
      class Meta:
          model = Student
          fields = ['current_CGPA']
  </code></pre>
  
  <p>I have used custom template for form rendering</p>
  
  <pre><code>&lt;label class="form-label" for="current_CGPA"&gt;CGPA upto previous semester&lt;/label&gt;
  &lt;input class="form-control" type="number" step="0.01" placeholder="CGPA" id="current_CGPA" name="current_CGPA" {% if student.current_CGPA is not None %}value="{{student.current_CGPA}}"{% endif %} required min=0 max=10/&gt;
              {{form.current_CGPA.errors}}
  </code></pre>
  
  <p>When i submit the request and validates form (like this) </p>
  
  <pre><code>user = request.user
  student = Student.objects.get(user=user)
  if request.method == 'POST':
          form = StudentAcademicsForm(request.POST, instance=student)
          if form.is_valid():
              form.save()
  else:
          form = StudentAcademicsForm()
  </code></pre>
  
  <p>this error occurs:</p>
  
  <pre><code>TypeError at /student/home
  conversion from dict to Decimal is not supported
  </code></pre>
  
  <p>On going through stacktrace i found that <code>get_attr()</code> method on my field 'current_CGPA' returns all attributes of POST in the format
  <code>{
  'current_CGPA':3,...
  }</code>
  I think its expected to return only the value '3'
  But this is something done by django built-in code
  So is it a bug?
  Has anyone used DecimalField before?
  If so then please correct me if I have done something wo</p>
  
  <p>Stacktrace is shown below:</p>
  
  <pre><code>Environment:
  
  
  Request Method: POST
  Request URL: http://localhost:8000/student/home
  
  Django Version: 2.0
  Python Version: 3.7.0
  Installed Applications:
  ['django.contrib.admin',
   'django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.messages',
   'whitenoise.runserver_nostatic',
   'django.contrib.staticfiles',
   'gep_app.apps.GepAppConfig']
  Installed Middleware:
  ['django.middleware.security.SecurityMiddleware',
   'whitenoise.middleware.WhiteNoiseMiddleware',
   'django.contrib.sessions.middleware.SessionMiddleware',
   'django.middleware.common.CommonMiddleware',
   'django.middleware.csrf.CsrfViewMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.contrib.messages.middleware.MessageMiddleware',
   'django.middleware.clickjacking.XFrameOptionsMiddleware']
  
  
  
  Traceback:
  
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
    35.             response = get_response(request)
  
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
    128.                 response = self.process_exception_by_middleware(e, request)
  
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
    126.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
  
  File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
    21.                 return view_func(request, *args, **kwargs)
  
  File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
    21.                 return view_func(request, *args, **kwargs)
  
  File "/code/gep_project/gep_app/views.py" in student_home
    49.       if form.is_valid():
  
  File "/usr/local/lib/python3.7/site-packages/django/forms/forms.py" in is_valid
    179.         return self.is_bound and not self.errors
  
  File "/usr/local/lib/python3.7/site-packages/django/forms/forms.py" in errors
    174.             self.full_clean()
  
  File "/usr/local/lib/python3.7/site-packages/django/forms/forms.py" in full_clean
    378.         self._post_clean()
  
  File "/usr/local/lib/python3.7/site-packages/django/forms/models.py" in _post_clean
    401.             self.instance.full_clean(exclude=exclude, validate_unique=False)
  
  File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py" in full_clean
    1144.             self.clean_fields(exclude=exclude)
  
  File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py" in clean_fields
    1186.                 setattr(self, f.attname, f.clean(raw_value, self))
  
  File "/usr/local/lib/python3.7/site-packages/django/db/models/fields/__init__.py" in clean
    606.         value = self.to_python(value)
  
  File "/usr/local/lib/python3.7/site-packages/django/db/models/fields/__init__.py" in to_python
    1553.             return decimal.Decimal(value)
  
  Exception Type: TypeError at /student/home
  Exception Value: conversion from dict to Decimal is not supported`
  </code></pre>