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
ing 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 {{form.errors}}, but couldn't fix he

Re: form.errors

2013-07-12 Thread Daniel Roseman
. I > tried {{form.errors}}, but couldn't fix he problem. Please guide me. > Thank you. > > > > def register_page(request): > if request.method == 'POST': > form = RegistrationForm(request.POST) > if form.is_

Re: form.errors

2013-07-11 Thread Kakar Arunachal Service
rm':form}) >> >> Cheers >> >> >> On Thu, Jul 11, 2013 at 4:08 PM, Kakar Arunachal Service < >> kakararunachalserv...@gmail.com> wrote: >> >>> Hi, >>> I am learning Django from an old Django version book, and i am stuck >>

Re: form.errors

2013-07-11 Thread Kakar Arunachal Service
ing 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 {{form.errors}}, but couldn't fix he problem. Please guide me. >> Thank you. >> >> This is my forms.py: >> >> fr

Re: form.errors

2013-07-11 Thread carlos
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 {{form.errors}}, but couldn't fix he problem. Please guide me. > Thank y

form.errors

2013-07-11 Thread Kakar Arunachal Service
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 {{form.errors}}, but couldn't fix he problem. Please guide me.

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

Re: form.errors is not a dictionary?

2012-08-01 Thread vivek soundrapandi
form = ItemForm(request.POST) > if form.is_valid(): > url = form.cleaned_data['url'] > item.save() > return HttpResponseRedirect('/') > else: > print form.errors > > when I submit the for

Re: form.errors is not a dictionary?

2011-04-05 Thread Daniel Roseman
form.is_valid(): > url = form.cleaned_data['url'] > item.save() > return HttpResponseRedirect('/') > else: > print form.errors > > when I submit the form, I expected that form.errors would print out as >

form.errors is not a dictionary?

2011-04-05 Thread Roy Smith
turn HttpResponseRedirect('/') else: print form.errors when I submit the form, I expected that form.errors would print out as a dict, as documented in http://docs.djangoproject.com/en/1.3/ref/forms/api/#using-forms-to-validate-data. Instead, I'm getting a hunk of HT

RE: Documentation Checked But Unclear: How to supress form.errors from views when needed?

2011-04-04 Thread Henry Versemann
But Unclear: How to supress form.errors from views when needed? I dont understand so you render a view with a form once and you get form errors on the initial view? Or Is there a POST/GET with formdata being submitted generating this issue? *which would be by design as fas as i can tell you wa

Re: Documentation Checked But Unclear: How to supress form.errors from views when needed?

2011-04-03 Thread Sam Walters
hat I can check if there are errors for particular > fields(like this  if form.errors.has_key('title') : >        titleerrors = len(form.errors['title'] titleerrors = > str(titleerrors))) and then display the counts on the screen, but I > have not figured out how to su

Re: Documentation Checked But Unclear: How to supress form.errors from views when needed?

2011-03-30 Thread Shawn Milochik
What do you mean by "if I refresh a page"? If you refresh a page that has a form on it but has not been submitted, I wouldn't expect the behavior you describe. If you submit a form improperly and it displays errors, then you hit 'refresh,' the view will still get the POST (or GET) and will do what

Documentation Checked But Unclear: How to supress form.errors from views when needed?

2011-03-30 Thread hank23
not found anything that works. I know in a view that I can check if there are errors for particular fields(like this if form.errors.has_key('title') : titleerrors = len(form.errors['title'] titleerrors = str(titleerrors))) and then display the counts on the screen, bu

Checking for/Displaying form.errors

2011-01-14 Thread hank23
1. Is there a way to look for particular errors within the form.errors dictionary by somehow specifying either a message key or value? If so what's the format? 2. Is it possible to specify the format of error messages displayed say as a paragraph instead of a list item or with a specific

Re: Has form.errors been deprecated?

2009-12-07 Thread Daniel Roseman
On Dec 8, 4:23 am, Continuation wrote: > I want a way to tell if the form submitted contains errors or not. > > There're django snippets that use the field form.errors to test for > errors (like this one:http://www.djangosnippets.org/snippets/1094/) > > And when I looked at

Has form.errors been deprecated?

2009-12-07 Thread Continuation
I want a way to tell if the form submitted contains errors or not. There're django snippets that use the field form.errors to test for errors (like this one: http://www.djangosnippets.org/snippets/1094/ ) And when I looked at my own form.errors, it indeed contains the error messages. Ho

Re: Iterating for the form.errors dictionary

2009-06-08 Thread Tom
from {% for key in form.errors.keys %}, key is the (k,v) for form.errors dictionary. key={{key}} shows what the key contains. In this case, it is something like "__all__" According to the dot notation, I should be able to use form.errors.key to access the array of error messages

Re: Iterating for the form.errors dictionary

2009-06-08 Thread Rama Vadakattu
you have to use the below code to print messages instead of keys {% for key,message in form.errors %} {{ message|striptags }} {% endfor %} On Jun 9, 11:21 am, Rama Vadakattu wrote: > {% for message in form.errors.key %} >       {{message|striptags}} >  {% endfor %

Re: Iterating for the form.errors dictionary

2009-06-08 Thread Rama Vadakattu
gt; show all the errors in the login form: > >   {% if form.errors %} >   Login Failed. Please try again. >   {% for key in form.errors.keys %} >     >      key={{key}},value= >      {% for message in form.errors.key %} >      {{message|striptags}} >      {% endfor %} &g

Iterating for the form.errors dictionary

2009-06-08 Thread Tom
Hi all, Leveraging the default login view, I want to use my own login.html to show all the errors in the login form: {% if form.errors %} Login Failed. Please try again. {% for key in form.errors.keys %} key={{key}},value= {% for message in form.errors.key %} {{message

looping through form.errors in templates

2009-05-17 Thread simon101
following error{{ form.error_dict| pluralize }}: {% for elem in form.error_dict.items %} {{ elem.0 }}: {{ elem.1.0 }} {% endfor %} {% endif %} I've had to replace form.has_errors with form.errors, as shown below: {% if form.errors %} Please correct the following error{{ form.e

generic view and {{ form.errors }}

2006-02-03 Thread coulix
.error_dict }} works perfectly it show me the dictionary with the recquired fiedls. However {{ form.errors }} is empty. {% for e in errors.items %} {{ e }}Field "{{ e.0 }}": {{ e.1|join:", " }} {% endfor %} doesn't show me the errors. maybe i should use {% for e in f