[web2py] Re: loading db in module - AttributeError: 'thread._local' object has no attribute 'db'

2011-12-06 Thread Francisco Costa
tx Bruno, I have db in __init__ How can I pass it to another function? this other function has a @spool decorator (from uwsgi decorators) so I can only call it with string arguments On Dec 6, 1:29 am, Bruno Rocha rochacbr...@gmail.com wrote: you cant assign db to current. you need to pass db to

[web2py] Re: loading db in module - AttributeError: 'thread._local' object has no attribute 'db'

2011-12-05 Thread Anthony
Read the callout box at the end of this section: http://web2py.com/book/default/chapter/04#Accessing-the-API-from-Python-modules. You're not supposed to assign items from 'current' to global variables within the module, which are defined only once when the module is first imported. Anthony

[web2py] Re: loading db in module - AttributeError: 'thread._local' object has no attribute 'db'

2011-12-05 Thread Francisco Costa
thanks Anthony, but how can I have access to db in modules then? On Dec 6, 1:14 am, Anthony abasta...@gmail.com wrote: Read the callout box at the end of this section:http://web2py.com/book/default/chapter/04#Accessing-the-API-from-Pyth You're not supposed to assign items from 'current' to

Re: [web2py] Re: loading db in module - AttributeError: 'thread._local' object has no attribute 'db'

2011-12-05 Thread Bruno Rocha
you cant assign db to current. you need to pass db to you class __init__ http://zerp.ly/rochacbruno Em 05/12/2011 23:21, Francisco Costa m...@franciscocosta.com escreveu: thanks Anthony, but how can I have access to db in modules then? On Dec 6, 1:14 am, Anthony abasta...@gmail.com wrote: