Django | How to pass form values to an redirected page

Posted by MMRUser on Stack Overflow See other posts from Stack Overflow or by MMRUser
Published on 2010-05-17T11:47:48Z Indexed on 2010/05/17 11:50 UTC
Read the original article Hit count: 157

Filed under:

Here's my function:

def check_form(request):
    if request.method == 'POST':
        form = UsersForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            try:
                newUser = form.save()
                return HttpResponseRedirect('/testproject/summery/)
            except Exception, ex:
                # sys.stderr.write('Value error: %s\n' % str(ex)
                return HttpResponse("Error %s" % str(ex))
        else:
            return render_to_response('index.html', {'form': form}, context_instance=RequestContext(request))
    else:
        form = CiviguardUsersForm()
    return render_to_response('index.html',context_instance=RequestContext(request))

I want to pass each and every field in to a page call summery and display all the fields when user submits the form, so then users can view it before confirming the registration.

Thanks..

© Stack Overflow or respective owner

Related posts about django