title: "' object has no attribute 'get' Error
body: <p>Have stuck here for 2 days. Hoping to get some enlightenment. The error code here is "'inputform' object has no attribute 'get'". I highly suspect the error is because of the forms.py. I want to make a dynammic choice field list there.</p>
  
  <p><strong>Model.py</strong></p>
  
  <pre><code>from django import forms
  from django.forms import ModelForm
  from django.db import models
  from dupont.models import dupont
  
  
  class input(models.Model):
     ...
      Region=models.CharField(max_length=100)
  </code></pre>
  
  <p><strong>Forms.py</strong></p>
  
  <pre><code>from django import forms
  from django.forms import ModelForm
  from .models import input
  from anothermodel.models import A   
  from django.contrib.auth.models import User
  import Queue
  
  class inputform(forms.ModelForm):
      regionlist = forms.ChoiceField(label=u'Region',choices=())
      def __init__(self,*args,**kwargs):
      super(inputform,self).__init__(*args,**kwargs)
      self.fields['regionlist'] = forms.ModelChoiceField(queryset=anothermodel.objects.values('Region').distinct())
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>from django.http import HttpResponseRedirect
  from django.shortcuts import render,render_to_response,get_object_or_404
  from inputform.forms import inputform
  from django.views.decorators.csrf import csrf_exempt
  
  @csrf_exempt
  def input(request):
      if request.method == 'POST': 
          form = inputform(request.POST) 
              if form.is_valid(): 
                  return HttpResponseRedirect('templates/About') 
      else:
          form = inputform() 
  
      return render_to_response('inputform.html', {
          'form': form,
      })
  </code></pre>
  
  <p><strong>Part of html</strong></p>
  
  <pre><code>&lt;body&gt;  
  &lt;script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;form action="" method="post"&gt;{% csrf_token %}
  
      {{ form.regionlist }}
          {% for region in form.regionlist.choices %}
              &lt;option value="{{ val }}" {% ifequal data.val val %}selected {% endifequal %}&gt;
          {% endfor %}
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>from django.conf.urls import patterns, include, url
  from django.contrib import admin
  from metrics import views
  from django.views.generic.list import ListView
  from django.views.generic import TemplateView
  from django.conf import settings
  from django.conf.urls.static import static
  from inputform.views import input,ifglobal
  admin.autodiscover()
  
  urlpatterns = patterns('',
      url(r'^login/',include('login.urls')),
      url(r'^admin/', include(admin.site.urls)),
  
      url(r'^input', 'inputform.views.inputform'),
  )
  </code></pre>
  
  <p><strong>The trackback</strong></p>
  
  <pre><code>Traceback:
  File "C:\Python27\lib\site-packages\django-1.8.3 py2.7.egg\django\core\handlers\base.py" in get_response
  223.                 response = middleware_method(request, response)
  File "C:\Python27\lib\site-packages\django-1.8.3-py2.7.egg\django\middleware\clickjacking.py" in process_response
    31.         if response.get('X-Frame-Options', None) is not None:
  
  Exception Type: AttributeError at /input
  Exception Value: 'inputform' object has no attribute 'get'
  </code></pre>