shouldn't this be:

if test0 != None and type(test0) == str:
query = (db.test1.test0 == test0)
elif test0 != None and type(test0) == list:
query = (db.test1.test0.belongs(test0) )
else:
query = (db.test1.id > 0)

On Saturday, 29 July 2017 02:27:41 UTC-5, 黄祥 wrote:
>
> thx 4 the way out massimo, another way is to use if condition that check 
> the data type
> *e.g.*
> if test0 != 'None' and type(test0) == 'str':
> query = (db.test1.test0 == test0)
> elif test0 != 'None' and type(test0) == 'list':
> query = (db.test1.test0.belongs(test0) )
> else:
> query = (db.test1.id > 0)
>
> thanks and best regards,
> stifan
>

-- 
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