Saturday, June 30, 2012

Re: i want to display a student profile from the database and am unable to do that.plz help

On Sat, 30 Jun 2012 11:54:35 -0700 (PDT), rick
<> declaimed the following in

> this is my
> def studentid(request):
> if request.method == 'POST':
> form = Student_loginForm(request.POST)
> if form.is_valid():
> cd = form.cleaned_data
> rollno = cd['rollno']
> p =
> rollno = request.POST.get('rollno')
> rollno=int(rollno)
> results = Add_record.objects.filter(Student_ID=rollno)
> return HttpResponseRedirect(reverse('',
> args=(results)))

Note: if args is supposed to be a tuple, you need to include a
trailing ,

args = (results, )

Otherwise, each item (if there are more than one) in results is
being treated as a separate positional argument.

Other than that minor syntactic nit, one may need to see

Also, what is the expected behavior if .is_valid() comes back false?

As coded, regardless of the .is_valid() return, you appear to fetch
"rollno" from the request object (replacing any value saved from the
clean data branch).
Wulfraed Dennis Lee Bieber AF6VN HTTP://

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment