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
>
>