empty passed to All -> 'Please Enter a Value'

"Kevin Mateo Lim" <[email protected]> Fri, 13 Jun 2008 18:54:03 -0400
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
Hey Guys,

I'm new to FormEncode, and I'm seeing some behavior that I don't expect.

I'm using the compound validator all to check to see if my username is
unique and plaintext

    username = All(UniqueUsername(),
validators.PlainText(not_empty=True, messages={'empty':"Yeah, go ahead
and enter a user name"}))

when the field is submitted empty, the error message that that prints
is always :
'Please enter a value'

which isn't the best user experience, imho.

the thing is, neither my custom UniqueUsername nor PlainText (with the
above messages dict) should output that message.

When I take both validators out of the All() compound, they both print
"Yeah, go ahead and enter a user name."

But once they're in there, it reverts back to the boring one.

Am I doing something wrong?

Best,
Kevin
Humble Newbie

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php