title: Django: "Form object has no attribute..." error
body: <p>I'm new in Django ,and I'm trying to develop a simple Django application which takes two numbers from the user with a form and do some operation with those numbers and print the result with a Http Response. My code is the following:</p>
  
  <p>forms.py</p>
  
  <pre><code>class SimpleForm(forms.ModelForm):
  
      a = forms.IntegerField(label='first' )
      b = forms.IntegerField(label='second' )
  
      def result(self):
          return doSomething(self.a, self.b)
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>class MainPage(FormView):
      template_name = 'simple.html'
      success_url = '/result/'
      form_class = SimpleForm
  
      def form_valid(self, form):
          return HttpResponse(form.result())
  </code></pre>
  
  <p>However, when I run this code on my localhost, it gives the error like</p>
  
  <pre><code>SimpleForm object has no attribute 'a'
  </code></pre>
  
  <p>So, what can be the problem? How can I get the user input in order to use it in my "result" function?</p>
  
  <p>Thanks in advance...</p>