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



-- 
Jorge Godoy      <[EMAIL PROTECTED]>

Attachment: pgpaIsxkaMbKu.pgp
Description: PGP signature

Reply via email to