Hello, i have a model that contains a person name and address information. The first form is to same their first name and last name. When the user clicks on the submit button it will take them to the person_address.html. When they click on the save button it will update the address information to the newly create person. My model contains many attributes, so i want to separate it into a two steps form. The first form will save their first and last name and so on. The second form will save their address and email and so on. How could i accomplisth this? Should i pass the key to the person_address.html, then pass that key to the function in the view.py? Can i pass the key when using return render_to_response ('person_address.html',{'form':form,})
Thank You. -T # ========= models.py ====== class personInfo(db.Model): """Basic user profile with personal details.""" first_name = db.StringProperty() last_name = db.StringProperty() company_name = db.StringProperty() title = db.StringProperty() street_address = db.StringProperty() city = db.StringProperty() state = db.StringProperty() zip_code = db.StringProperty() email = db.EmailProperty() # ========= view.py ========== def add_person(request): if request.method == 'POST': # If the form has been submitted... form = CreateBusinessForm(request.POST) if form.is_valid(): first_name = form.cleaned_data['first_name'] last_name = form.cleaned_data['last_name'] create_object(request, businesspromotion) return render_to_response('person_address.html',{'form':form,}) else: form = CreateBusinessForm() return render_to_response('person_info.html',{'form':form,}) # ===== person_address.html ============ {% extends 'layout.html' %} {% block title %}Create person{% endblock %} {% block content %} <h1>Business Form page2</h1> <a href="{% url myapp.views.list_people %}">Back to listing</a> <form action="" method="POST"> <p><label for="id_bstreet_address">Street Address:</label> <input id="id_bstreet_address" type="text" name="bstreet_address" maxlength="100" /></p> <p><label for="id_bcity">City:</label> <input id="id_bcity" type="text" name="bcity" maxlength="100" /></ p> {% if object %} <input type="submit" name="SaveAddress" value="Save Address"> {% endif %} </form> {% endblock %} --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---