|
Posted by apoorvabade |
|
|
def submit_details(request):
if request.method=='POST': form=SOFIATMUser(request.POST) print form.errors if form.is_valid(): user=SOFIAUserDetails( UserName='abc', Name=form.cleaned_data['user_name'], Phone=form.cleaned_data['user_phone'], Address=form.cleaned_data['user_address']) user.save() return HttpResponseRedirect('/') return HttpResponseRedirect('Above is the function. form.is_valid() is always returning false.. Can anyone help knowing the error... |
|
|
Posted by Herbert Poul ![]() |
|
|
hi,
what does: print "%s" % repr(form.errors) output? SCT - http://sct.sphene.net |
|
|
Posted by apoorvabade |
|
|
Sadly it is not giving anything... I tried that too... But it is not showing any error
|
|
|
Posted by Herbert Poul ![]() |
|
|
hmm.. it should at least output an empty array .. or False .. or None ... or at the very least an empty line. SCT - http://sct.sphene.net |
|
|
Posted by apoorvabade |
|
|
yes.. It is printing an empty line...
|
|
|
Posted by apoorvabade |
|
|
Actually I think request.POST dictionary is empty.. Cos i tried to print an element from it, it gives nothing
|
|
|
Posted by Herbert Poul ![]() |
|
|
this is weird.. is your form actually posting? have you tried outputting repr(request.POST) and repr(request.GET)
SCT - http://sct.sphene.net |
|
|
Posted by apoorvabade |
|
|
Ok.. i tried to print request.POST.. and it is showing the dictionary contents... But i am unable to get why is form.is_valid() returning false...
I have my SOFIATMUser a class extending forms.FORM |



