Hello

Can anyone tell me why when I get to the line - form =
InstanceForm(request.POST) in the following view (stepping through the
code), I get a Type Error SurveyForm object is not callable. My
understanding is that it should be as it subclasses Form

def addEditSurvey(request, id = None):

        if id is not None:
                instance = Survey.objects.get(id=id)
                InstanceForm = SurveyForm(instance = instance)
        else:
                InstanceForm = SurveyForm()

        if request.method == 'POST':
                form = InstanceForm(request.POST)
                if form.is_valid():
                        form.save()
                        return HttpResponseRedirect("/event/survey/list")

        return render_to_response('add_edit_survey.html', {'form':
InstanceForm})

Thanks in advance for any guidance on this

Cat


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to