On Nov 20, 4:03 pm, ayayalar <[EMAIL PROTECTED]> wrote:
> VIEW:
>
> def add_product(request):
>     if not request.method == 'POST':
>         form1 = ProductForm()
>         return render_to_response('index.html', {'form1' : form1})
>     else:
>         form1 = ProductForm(request.POST)
>         if form1.is_valid():
>             form1.save()
>             return HttpResponseRedirect('/thanks.html')
>
> def add_product_details(request):
>     if not request.method == 'POST':
>         form2 = ProductDetailForm()
>         return render_to_response('index.html', {'form2' : form2})
>     else:
>         if form2.is_valid():
>             form2.save()
>             return HttpResponseRedirect('/thanks.html')
>
> URLS
> urlpatterns = patterns('',
>
>     (r'^product/$', views.add_product),
>     (r'^product/$', views.add_product_details),
>
> Is this possible? For some reason the 2nd form never shows up

Well you need to pass both forms to the template to get them both to
show up.
--~--~---------~--~----~------------~-------~--~----~
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