Thank you Bruno!
I added  commons.db = db to my controller to make db globally available in
that module.
Thanks again!

With Regards,
Sathvik

On Mon, Nov 7, 2011 at 10:54 AM, Bruno Rocha <[email protected]> wrote:

>
>
> On Mon, Nov 7, 2011 at 2:55 AM, Sathvik Ponangi <[email protected]>wrote:
>
>> Dear Massimo,
>> Restarting AppEngine seems to have fixed this as well.
>> But now I get an error saying that
>>
>>> NameError: global name 'db' is not defined
>>
>> How do import db.py onto the module?
>>
>
> You cant import db onto a module, db is not seriazable.
>
> You have to pass it explicitly to the class instance
>
> class Foo(object):
>     def __init__(self, db):
>         self.db = db
>
> in controller
>
> from module import Foo
> foo = Foo(db)
>



-- 
Sathvik Ponangi

Reply via email to