On Thu, Mar 16, 2006 at 09:01:10AM -0300, Jorge Godoy wrote:
> Jason Chu <[EMAIL PROTECTED]> writes:
> 
> > As long as d['value'] was a valid integer (and not someone screwing with
> > our form...)
> 
> It it's someone screwing with the form, then you'd better show them a big
> error message -- instead of redisplaying the form -- or sending back an empty
> field.
> 
> There's a message for the error, anyway.  From the docs for the Int validator:
> 
> 
> formencode.validators.Int = class Int(formencode.api.FancyValidator)
>  |  Convert a value to an integer.
>  |  
>  |  Example::
>  |  
>  |      >>> Int.to_python('10')
>  |      10
>  |      >>> Int.to_python('ten')
>  |      Traceback (most recent call last):
>  |          ...
>  |      Invalid: Please enter an integer value

Point taken.

Jason

-- 
If you understand, things are just as they are.  If you do not understand,
things are just as they are.

Attachment: pgpa0S1mwOeEl.pgp
Description: PGP signature

Reply via email to