web2py patch, thanks to Boris Manojlovic
merge