There is no HttpResponse object returned if the form is *not* valid. You might want to return a template saying that the form input was incorrect.
Tervitades/Regards Karl Sutt On Fri, Jul 6, 2012 at 11:49 AM, manish girdhar <manishgirdha...@gmail.com>wrote: > hii tom, > yeah i have rectidy rollno = cd["rollno"] ,but again am getting error > didn't get an httpresponse object... > > this is my view. > > > def studentid(request): > if request.method == 'POST': > form = Student_loginForm(request.POST) > if form.is_valid(): > cd = form.cleaned_data > rollno = cd['rollno'] > return > HttpResponseRedirect(reverse('record_system.views.search' , args=(rollno))) > else: > form = Student_loginForm() > > return render_to_response('add_record/studentid.html', > context_instance=RequestContext(request)) > > > the error is in* "if form.is_valid: "*..its getting false and ultimately > the further process is not going on.. > > thanks in advance. > > > On Thu, Jul 5, 2012 at 7:34 PM, Tom Evans <tevans...@googlemail.com>wrote: > >> On Thu, Jul 5, 2012 at 8:38 AM, manish girdhar >> <manishgirdha...@gmail.com> wrote: >> > yes it was indentation error and i rectified that.thanks for the concern >> > friend.. >> > >> >> I would have thought that it was you refering to the undefined >> variable rollno here: >> >> cd = form.cleaned_data >> rollno = cd[rollno] >> rollno = request.POST.get(rollno) >> >> Should it not read: >> >> cd = form.cleaned_data >> rollno = cd["rollno"] >> rollno = request.POST.get(rollno) >> >> Cheers >> >> Tom >> >> -- >> 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 >> django-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> >> > -- > 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 > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.