Did you take a look at
http://www.djangoproject.com/documentation/newforms/#customizing-the-error-list-format
 ??

You could just return the error message without wrapping it in any
div/span/ul etc.

R

On Tue, 2008-04-29 at 22:23 -0700, Mike Chambers wrote:
> Thanks.
> 
> This was the only way I could get the string:
> 
> {% for s in form.user_name.errors %}{{s}}{% endfor %}
> 
> I tried some of the list template filters (such as slice, but didnt 
> havent any luck with them).
> 
> Are there instances where more than one validation error would be 
> returned for a specific field?
> 
> Thanks again for the help...
> 
> mike chambers
> 
> 
> Ronny Haryanto wrote:
> > On Wed, Apr 30, 2008 at 12:03 PM, Mike Chambers <[EMAIL PROTECTED]> wrote:
> >>          <div>
> >>                 <label for="id_name">Name</label>
> >>                 {{ form.user_name }} {{ form.user_name.errors }}
> >>          </div>
> > 
> >>  Is there any way to just get the raw error string?
> > 
> > You should be able to treat form.user_name.errors as a python list
> > (e.g. iterate with for, join, etc).
> > 
> > Ronny
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to