Hi,
 
I have a cutom form which I am displaying using SQLFORM.factory as given 
below:
 
searchform=SQLFORM.factory(
        Field('uid', 'integer', requires=[IS_LENGTH(15,15)]),
        Field('uaccount','unicode',default=None))
if searchform.accepts(request.vars):
        result=__get_payments()
    else:
        response.flash = 'please fill the form'     
    return dict(form=searchform)
 
I have 2 questions here which are given as follows:
 
1. I want *uid* must be an integer and form should not be accepted 
if string value is supplied.
But even if I enter string value in uid field, it still accepts the 
form.What do I do to achieve this?
 
2. If *uaccount *is not supplied, I want it to be None. But when I try to 
access it using request.vars.uaccount, I get empty string value. I think I 
should rather get None value. Please suggest.
 
Thank you.
 

-- 

--- 
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/groups/opt_out.

Reply via email to