Re: form.errors

2013-07-12 Thread Kakar Arunachal Service
Okay. Thank you so very much! Just one last question, just to know that i got it right. So, variables and return are not part of the else clause, and that they return the errors of the last form post. Did i got it right? On Fri, Jul 12, 2013 at 8:41 PM, Daniel Roseman wrote: > On Friday, 12 July

Re: form.errors

2013-07-12 Thread Daniel Roseman
On Friday, 12 July 2013 14:27:31 UTC+1, Kakar wrote: > Okay! That did solved the problem. Thank you! Here's my new view.py: > > def register_page(request): > if request.method == 'POST': > form = RegistrationForm(request.POST) > if form.is_valid(): > user = User.obj

Re: form.errors

2013-07-12 Thread Kakar Arunachal Service
Okay! That did solved the problem. Thank you! Here's my new view.py: def register_page(request): if request.method == 'POST': form = RegistrationForm(request.POST) if form.is_valid(): user = User.objects.create_user( username=form.cleaned_data['usern

Re: form.errors

2013-07-12 Thread Daniel Roseman
On Thursday, 11 July 2013 23:08:25 UTC+1, Kakar wrote: > Hi, > I am learning Django from an old Django version book, and i am stuck with > a problem regarding forms. When i render forms, i get the registration > right, but if its incorrect, it does not show the error msg in the html. I > tried

Re: form.errors

2013-07-11 Thread Kakar Arunachal Service
Its just displaying form again, but without any errors. Please guide me to where am missing something. On Fri, Jul 12, 2013 at 4:34 AM, Kakar Arunachal Service < kakararunachalserv...@gmail.com> wrote: > I am sorry, but its still not displaying any errors after it renders. > > > On Fri, Jul 12,

Re: form.errors

2013-07-11 Thread Kakar Arunachal Service
I am sorry, but its still not displaying any errors after it renders. On Fri, Jul 12, 2013 at 3:47 AM, carlos wrote: > try this with django 1.5.1 > from django.shortcuts import render > > def register_page(request): > if request.method == 'POST': > form = RegistrationForm(request.PO

Re: form.errors

2013-07-11 Thread carlos
try this with django 1.5.1 from django.shortcuts import render def register_page(request): if request.method == 'POST': form = RegistrationForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect('/register/success/') else:

Re: form.errors is not a dictionary?

2012-08-01 Thread Victor Rocha
Read the above reply. When you print form.error --> prints out a custom __unicode__ for you to use in your templates. However, you can iterate over form.errors and it will act as a normal dict. On Wednesday, August 1, 2012 1:56:28 AM UTC-4, vivek soundrapandi wrote: > > I too have the same pro

Re: form.errors is not a dictionary?

2012-08-01 Thread vivek soundrapandi
I too have the same problem. How did you fix it? On Wednesday, April 6, 2011 2:13:48 AM UTC+5:30, Roy Smith wrote: > > I'm using django-1.3 . I have a view with the following code: > > def item_create(request): > if request.method == 'POST': > form = ItemForm(request.POST) >

Re: form.errors is not a dictionary?

2011-04-05 Thread Daniel Roseman
On Tuesday, April 5, 2011 9:43:48 PM UTC+1, Roy Smith wrote: > > I'm using django-1.3 . I have a view with the following code: > > def item_create(request): > if request.method == 'POST': > form = ItemForm(request.POST) > if form.is_valid(): > url = form.clea