On Tue, Aug 4, 2009 at 11:17 AM, CrabbyPete<pete.do...@gmail.com> wrote:
>
> I want to return an error that a user was not found. I wanted to add
> the error and have it formatted using errorlist as happens with a
> required field. So I did the following
>
> lform._errors['username']  = ErrorList("User does not exist or wrong
> password")
>
> The result in lform.errors is
>
> ErrorDict: <ul class="errorlist"><li>username<ul
> class="errorlist"><li>U</li><li>s</li><li>e</li><li>r</li><li> </
> li><li>d</li><li>o</li><li>e</li><li>s</li><li> </li><li>n</li><li>o</
> li><li>t</li><li> </li><li>e</li><li>x</li><li>i</li><li>s</li><li>t</
> li><li> </li><li>o</li><li>r</li><li> </li><li>w</li><li>r</li><li>o</
> li><li>n</li><li>g</li><li> </li><li>p</li><li>a</li><li>s</li><li>s</
> li><li>w</li><li>o</li><li>r</li><li>d</li></ul></li></ul> ...
>
>
> instead of :
> <ul class="errorlist"><li>username<ul class="errorlist"><li>User does
> not exist or wrong password</li>
>
> What am I doing wrong?
>
>
>
>
>
> >
>


Do ErrorList(["User does...."]).

Alex
-- 
"I disapprove of what you say, but I will defend to the death your
right to say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you
want" -- Me

--~--~---------~--~----~------------~-------~--~----~
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