is there more elegant way to prevent integer input in form?

the below method works but wonder if there is more elegant way.  
is_int_in_range seems okay but am concerned that malicious user may type 
something beyond my range


    if form.process().accepted: 
        try:
            if form.vars.role + 1: # check to see if input can be added. No 
crash means user typed in a number.
                
redirect(URL('message_that_integers_not_allowed_Start_over'))
        except:
            redirect(URL('data_is_good')) # form crashes if user types 
non-integer so data is good. Process input.
        else:
            pass
        ....... etc.

thanks,

Alex Glaros

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to