title: Error:'Answer' object has no attribute 'get'?
body: <p>I'm using Django 1.11.
  when I'm using this code it works with me but when I'm trying to add new condition besides in this case (else) I get this error:<br>
   <a href="https://i.stack.imgur.com/jYf37.png" rel="nofollow noreferrer">image</a> <br>
  I want to put a new condition to stop anyone could put (get method) on my page, How can so?<br></p>
  
  <p>favourite.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Favourite Page&lt;/title&gt;
      &lt;style&gt;
          input {padding: 8px;margin-top: 5px}
          label {display: inline-block}
          .input {display: inline-block}
  
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      {% if form_data %}
          {{ form_data.question }}
  
      {% else %}
      &lt;form action="{% url 'market:favourite' %}" method="post"&gt;
          {% csrf_token %}
          {% include 'market/template-form.html' %}
          &lt;input type="submit"&gt;
      &lt;/form&gt;
      {% endif %}
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def favourite(request):
      context = {}
      form = Answer
      context['form'] = form
      if request.method == 'POST':
          form = form(request.POST)
          if form.is_valid:
              form.save(commit=False)
              return render(request, 'market/favourite.html', {'form_data': form.cleaned_data})
      else:
          form = Answer()
          return form
      return render(request, 'market/favourite.html', {'form': form})&lt;br&gt;
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code>from .models import Question
  from django import forms
  
  
  class Answer(forms.ModelForm):
      class Meta:
          model = Question
          fields = ['question']
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>CHOICE = [(1, 'Si'), (2, 'No')]
  
  class Question(models.Model):
      question = models.IntegerField(choices=CHOICE, default=1, blank=False)
  </code></pre>