Hello,
I am implementing a small system which (simplified) should be like
this:
1. The user enters some information in a form.
2. The form content is validated.
3. The user is redirected to a new page (pure HTML / form ??)
summarizing
the information in the first form, and given the choices:
A: Go back and correct the information.
B: Confirm that the information is correct. (In this case I plan
to hit the database with updated information).
Currently the code looks roughly like this:
--------------------------------------------------------------------------------------
def InputForm( forms.Form ):
name = forms.CharField( max_length = 100)
email = forms.EmailField( )
# This is the view called in 1 above (have omitted some csrf magic).
def initial_view( request ):
if request.method == "GET":
form = InputForm()
else:
form = InputForm( reques.POST )
if form.is_valid():
return HttpResponseRedirect( "/last_chance/" , )
>--------------------------------\
return render_to_response( "form_template.html" ,
request ) |
|
|
# In this view I would like to display the input the user entered in
the previous form. |
def last_chance_view( request ):
<--------------------------------------------------------------/
return render_to_response()??
--------------------------------------------------------------------------------------
Now; the question I have is how to pass the validated input values
(i.e. name and email) from initial_view() on to the last_chance_view()
(as indicated with the ASCII arrow in the code above).
Joakim
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.