If I have a form and  if  form.is_valid is False

The code code in the template {{ form.name.errors}} formats the error
like this.
<div><ul class="errorlist"><li>This field is required.</li></ul></div>

How do you add an error so it gets formatted with the surrounding
html. If a user name already exists I want to add the error message
'User name already in use'

I tried form._errors[name] = 'User name already in use' and
{{form.name.errors}} just prints the string.



--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to