On Sep 29, 11:56 pm, apple <simo...@gmail.com> wrote:
> I also want to know the answer to this. I have followed an example but
> could not get it to work.
>
> In model I have:
>
> from globals import current
> from gluon.storage import *
> current.app=Storage()
> current.app.db=db
>
> If I put in my module X:
> from globals import current
> then it says "no module named X"
>
> If I leave it out I can refer to current.request in the module but I
> refer to current.app.db and it says 'thread._local' object has no
> attribute 'app'
>
> On Sep 29, 8:43 pm, howesc <how...@umich.edu> wrote:
>
> > Hi all,
>
> > pardon the potential duplication here, but i swear i saw something in the
> > last month or so that indicated that i can import the db object into my
> > module so that i did not have to pass it in with each function call. is
> > this true? can someone help me with the syntax?
>
> > thanks,
>
> > christian
>
>