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 associated since

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 %} > > The abov

Re: Iterating for the form.errors dictionary

2009-06-08 Thread Rama Vadakattu
{% for message in form.errors.key %} {{message|striptags}} {% endfor %} The above will print keys instead of values as message is key not a value. On Jun 9, 11:06 am, Tom wrote: > Hi all, > > Leveraging the default login view, I want to use my own login.html to > show all th

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|