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)

return error traceback when access 
http://127.0.0.1:8000/a/default/test1?test0=None#
*ValueError: invalid literal for long() with base 10: 'None'*

this works
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)

sometime i confuse the null value (None or '') in web2py, what works in 
models or database side and what works in controllers and views side is 
different.
like example above, when i put the code in models None is works but as an 
example above i put it on controllers or view side, it should be 'None'
another thing is for query or update value to set null value assign it into 
None or ''

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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to