[Twisted-web] Rendering error messages

Michael Wilson michael.wilson at gmail.com
Thu Dec 16 18:30:13 MST 2004


Here's the answer to my own question:

      partialForm = {}
      
      args = ctx.locate(inevow.IRequest).args
      partialForm.update(args)

Then:

     raise annotate.ValidateError( errors,
          formErrorMessage="Something!",   partialForm=partialForm )





On Wed, 15 Dec 2004 21:48:36 -0800, Michael Wilson
<michael.wilson at gmail.com> wrote:
> Ok, mea culpa, mea culpa. Read it, used it.
> 
> One last question (I hope) (and this time I did visit the docs, and
> the implementation and even an italian news group).
> 
> When I get a form which has errors, I am now getting nice error
> messages, but the input values are cleared, so the user gets something
> like "Invalid email address", but the field is now blank.
> 
> I see the "defaultsFactory", but it seems like it's for default
> values, not remembering prior values.
> 
> What should I visit now? :-)
> 
> 
> On Wed, 15 Dec 2004 18:54:12 -0800, Donovan Preston <dp at ulaluma.com> wrote:
> >
> > On Dec 15, 2004, at 6:25 PM, Michael Wilson wrote:
> >
> > > 2. When I process a form and I want to put a message in the _forms_
> > > error message field, how do I do that? I've tried dict keys of
> > > "error", "form", etc, but none of them work.
> >
> > There are additional parameters to the exception constructor. Go read
> > the docstring and perhaps the implementation, all should be clear.
> >
> > dp
> >
> >
>



More information about the Twisted-web mailing list