Django: How do I call a model function in views that accesses form data and stores the result in the database?
<p>I am a beginner in Django. I am developing an app in Django. I need to store the result of a form in the database, and call a function in views, and then store the result of that function in my database again.
In models.py, this is my model class with the calculate function: </p>

<pre><code>class f1New(models.Model):
    v1 = models.CharField(max_length=5)
    u1 = models.CharField(max_length=5)
    a1 = models.CharField(max_length=5)
    t1 = models.CharField(max_length=5)
    def calculate(v1,u1,a1,t1):
        v1 = u1 + a1
</code></pre>

<p>In views.py, </p>

<pre><code>def f1(request):
    context = RequestContext(request)
    if request.method == 'POST':
        form = f1Form(request.POST)
        if form.is_valid():
            form.save(commit=True)
            f1.calculate(form[v1],form[u1],form[a1],form[t1])
            return question_list(request)
        else:
            print form.errors
    else:
        print ("Not Post")
    return render_to_response('question_list.html', {'form': form}, context)
</code></pre>

<p>I do not know if this is correct, and don't know how to check it. 
Any help would be highly appreciated. :)</p>