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.

Reply via email to