Hi guys, im asking again :), i don't know how make this.
My English is not too good, but ill try to asking this:
how ill validate a form and go back to the preview url (the same view form) and show the validation errors?, im asking this because i have 2 form's, the first form's action is going to a second form (POST), but in this second form (view?) i need to validate the first form, if the first form is valid i want to show the second form else ill show the first form with errors.
i dont know if im clear , im sorry.
im thinking about this:
def secondForm(request):
if request.method =='POST':
form = FirstForm(request.POST)
if form.is_valid():
fields = request.POST.copy()
# showing the second form?? with x differents fields, i have 2.
if fields['xvalue']=='1': # this is from radio buttons
form2 = xSecondForm()
elif fields['xvalue']=='2':
form2 = ySecondForm()
else:
# here go back with erros msgs????
#return render_to_response('firstFormTemplate.html',{'form': form}, context_instance=RequestContext(request))
else:
#return something or go back ???
Thanks guys PD: im happy, im coding Django + python :D