I pass db to module... Works fine... But I was setting (in the model):
dog = 'dog12345' So.. in the module I see db and not dog... To make it work, I should pass dog also.... As I have many associations in this project, this wold make it almost impossible to implement.... On Mon, Jan 16, 2012 at 5:15 PM, Marin Pranjić <[email protected]>wrote: > > On Mon, Jan 16, 2012 at 5:56 PM, Marcello <[email protected]> wrote: > >> Would be great.... >> >> This solution works great... but it's not accessible in the modules >> files, because dog is not visible there... >> >> You can pass everything into modules using current object. > In controller: > > current.db = db > > in module > > from gluon import current > def module_function(): > db = current.db > > > don't do it as global, it should be inside some "module_function" bacause > it has to be executed for every request. > > > > Marin >

