[Twisted-web] Returning Deferred from coerce method in formless -
andrea at cpushare.com
Wed Jun 15 21:43:29 MDT 2005
On Wed, Jun 15, 2005 at 07:46:46PM +0200, Michal Pasternak wrote:
> various reasons. You could validate an e-mail address using
> queries to DNS servers, or you could validate login name
FWIW, I also needed to return deferred from coerce.
Right now I'm using the autocallable to do that. The autocallable
returns annotate.ValidateError if something goes wrong.
But the dns is checked only if all the coerce methods all passes, so I
can't show the dns error until all coerce passed, which made the dns
check a kind of last special check, for no good reason. It'd be more
coherent to check for all errors even when some other coerce in the same
Thanks for working to add this feature.
BTW, I'd also need "context" to be passed to the coerce method (as last
argument), I had to write my own ProcessTypedContext to do that, and
it'd be much nicer if the default formless process handler would pass
the context to coerce too (though I believe it would break current apps,
but it'd be a very visible breakage, no risk of silent malfunctions at
runtime). Said that I also appreciate backwards compatibility ;)
I need the context in order to reach the session with
inevow.ISession(ctx) inside the coerce handler.
More information about the Twisted-web