I have a possible solution in trunk. Please check it. I do not like the implementation but it not worse than then current implementation of LOAD.
In order to make it work I had to store the global execution environment in current.globalenv I think there is room for a lot of cleanup since, once globalenv is in current, we do not need to pass it around too much. Massimo On Nov 25, 10:51 pm, Anthony <[email protected]> wrote: > Just submitted an > issue:http://code.google.com/p/web2py/issues/detail?id=538 > > Anthony > > > > > > > > On Friday, November 25, 2011 11:47:07 PM UTC-5, Massimo Di Pierro wrote: > > > I like Martin's solution. Or shorter: > > > from gluon.compileapp import LoadFactory > > LOAD = > > LoadFactory({'request':current.request,'response':current.response}) > > > After this you can do: > > > form_loader_div = DIV(LOAD(c = self.controller, f = self.function, > > args = > > add_args, ajax = True), _id = my_select_id + "_dialog-form", _title = > > self.form_title) > > > LOAD should be in gluon as the other helpers. Please open a ticket on > > google code. It should be possible to do it. > > > On Nov 25, 3:29 pm, Martín Mulone <[email protected]> wrote: > > > try something like this > > > > from gluon.compileapp import LoadFactory > > > def renderimages(self, page=1, postid=0): > > > """ Render Images """ > > > > curvars = {} > > > curvars['page']=page > > > curvars['postid']=postid > > > > environment = {} > > > environment['request'] = current.request > > > environment['response'] = current.response > > > LOAD = LoadFactory(environment) > > > > return LOAD(self.controller_name, 'imageslist.html', > > > vars=curvars, ajax=True) > > > > 2011/11/25 monotasker <[email protected]> > > > > > Hmmm ... Those don't seem to be working. > > > > > from gluon import LOAD > > > > > This doesn't seem to import anything. PyDev tells me that there's an > > > > "unresolved import" Still get the 'NoneType not callable' error. > > > > > from gluon import current > > > > LOAD = current.LOAD > > > > > I get AttributeError: 'thread._local' object has no attribute 'LOAD' > > > > -- > > > http://martin.tecnodoc.com.ar

