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)

Reply via email to