I was wondering about that, Massimo. The odd is that sometime before, I was running the same code in the same way. And I assumed that the HTTP request lives while selenium calls a controller with the Web2py running. I will try the command that you stated and to see the discussion that you said.
Thanks a lot, Massimo. On Thursday, October 10, 2013 11:25:39 AM UTC-3, Matheus Cardoso wrote: > > Hi guys, > > Sorry if the following question was already answered, but I could not > find nothing like this in this list, stack or in others lists. Here is the > thing: I wrote some tests that already was working. I got back to the code, > after some time, and then: 'thread._local' object has no attribute (in this > case, the classic 'db'). Here is my code: > > In models/0.py > > db = > DAL(db_postgres_url,pool_size=1,check_reserved=['all'],fake_migrate_all=False) > > from gluon import current > current.db = db > > In module/my_module.py > > from gluon import * > def some_function(): > #some db stuff calling current.db > > However, the 'thread._local' object has no attribute db keeps raising. I > tried other approach like > > In models/0.py > > db = > DAL(db_postgres_url,pool_size=1,check_reserved=['all'],fake_migrate_all=False) > > from gluon import current > from storage import Storage > current.toc = Storage() > current.toc.db = db > > But then, the same error, but with "toc", raises again. Is there any > changes in Web2py that changed this behavior? > > > > > -- 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/groups/opt_out.

