I just ran into this problem too and decided to solve it like this: in my controller:
from gluon import current a_module = local_import('a_module') def a_function(): a_module.something_cool(auth, current) The db connection is available as auth.db, and the request, session, and response are in current. On Thursday, February 9, 2012 11:31:08 PM UTC+11, spyker wrote: > > I am not ready with this project to try out Bruno's way of setting up a > database using modules and not models. > > But I want to be able to do something like this in a module: > > def number_or_records(table): > count = db(db[table]).count() > > > > -- > Because experiencing your loyal love is better than life itself, > my lips will praise you. (Psalm 63:3) > >