In case anyone else runs into a similar problem, it turns out that I was 
handling DAL and Crud improperly in the modules I was trying to import. For 
db, I added this in db.py right after the initial definition of db:

current.db = db

Then in my model, in any function that used db, I could just retrieve it 
like this:

db = current.db

With Crud, I could import Crud from gluon.tools at the top of each module 
file. Then in a function (after defining db) I could just define

crud = Crud(db)

With those two changes the imports worked fine. I'm sure all of this was in 
the web2py manual somewhere, but I didn't understand it there. It was 
looking through other questions and answers here on the google group that 
finally clued me in. Thanks to everyone in those discussions (I don't have 
the links, but you know who you are!).

Reply via email to