This is a very beginner question:

Say a user has just filled out a form and hit the submit button.  They
are redirected to an order confirmation page.  How can I retrieve the
one row of data the user just submitted and display it on the order
confirmation page?

Here is my simple View so far, but it currently displays all the user
inputed data, not the specific row the user just entered:

articles = Context({'articles': Articles.objects.all()})
order_info = Context({'order_data': Order_Info.objects.all()})

def order(request):
        if request.method == 'POST':
                form = OrderForm(request.POST)
                if form.is_valid():
                        form.save()

                        return HttpResponseRedirect('/order_complete/')
        else:
                form = OrderForm()

        return render_to_response('order.html', {'form': form}, articles)

def order_complete(request):
        return render_to_response('order_complete.html', order_info,
articles)

Thanks for your help!

--

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


Reply via email to