thanks for the help friend..after manipulate that thing i got an error of* *UnboundLocalError at /record_system/studentid/
local variable 'rollno' referenced before assignment ... On Thu, Jul 5, 2012 at 11:52 AM, dizzydoc <htc.karanagar...@gmail.com>wrote: > The only condition where this view wont return an HTTPResponse is when > request.method == 'POST' is True and form.is_valid() is False. > > In this condition the outer if condtion would complete execution and exit > out since inner if condition is False and wont enter inner if condition. > > I think you should move out the return statement from the else loop. > > > On Thursday, July 5, 2012 10:43:29 AM UTC+5:30, rick wrote: >> >> >> i want to filter roll no from database,but when i enter the number >> ,browser gives *view didn't return 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] >> rollno = request.POST.get(rollno) >> results = Add_record.objects.filter(**Student_ID=rollno) >> return >> HttpResponseRedirect(reverse('**record_system.views.search' >> ,args=(results,))) >> else: >> form = Student_loginForm >> return render_to_response('add_**record/studentid.html', >> context_instance=**RequestContext(request)) >> >> >> please help... >> thanks in advance. >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/6178-1cjLacJ. > > 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.