Massimo, in compileapp.py, I think you need to change:
 
124. other_request.vars = vars
125. other_request.get_vars = vars
to:

124. other_request.vars = Storage(vars)
125. other_request.get_vars = Storage(vars)
 
Otherwise, request.vars in a non-ajax component is just a dict instead of a 
Storage object, so if you try to access a non-existent request variable, you 
get an error.
 
Anthony

On Monday, June 27, 2011 4:41:40 AM UTC-4, apple wrote:

> Just add this to the top of the test function 
>         print(request.vars) 
>         print(request.vars.table) 
>
> request.vars prints the storage object as expected. However any 
> reference to request.vars.table or request.vars["table"] causes 
> failure. 
>
> On Jun 27, 12:22 am, Massimo Di Pierro <massimo....@gmail.com> 
> wrote: 
> > I cannot reproduce this. I just tried this and it works: 
> > 
> > def index(): 
> >     load = LOAD(f='test.load',ajax=False,vars=dict(table='customer')) 
> >     return locals() 
> > 
> > def test(): 
> >     return 'hello world' 
> > 
> > Would you send me a minimalist app so I can reproduce it. It is not a 
> > good idea to call an action "list" because that is a python keyword, 
> > but that should not causing your problem. 
> > 
> > On Jun 26, 6:14 pm, apple <sim...@gmail.com> wrote: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > no difference. with ajax=True it works. with ajax=False it throws a 
> > > restricted error. 
> > 
> > > On Jun 26, 11:50 pm, Massimo Di Pierro <massimo....@gmail.com> 
> > > wrote: 
> > 
> > > > How about you specify the controller? 
> > 
> > > > {{=LOAD('default','list.load', ajax=False, 
> > > > vars=dict(table='customer'))}} 
> > 
> > > > On Jun 26, 5:18 pm, apple <sim...@gmail.com> wrote: 
> > 
> > > > > yes. works fine if I just type it in the url box. 
> > 
> > > > > On Jun 26, 9:57 pm, Massimo Di Pierro <massimo....@gmail.com> 
> > > > > wrote: 
> > 
> > > > > > Can you call the list.load action directly? Do you get a ticket? 
> > 
> > > > > > On Jun 26, 3:01 pm, apple <sim...@gmail.com> wrote: 
> > 
> > > > > > > {{=LOAD(f='list.load', ajax=True, 
> vars=dict(table='customer'))}} 
> > 
> > > > > > > Works fine but if I change to ajax=False then it gives a 
> restricted 
> > > > > > > error. 
> > 
> > > > > > > On Jun 26, 7:29 pm, Massimo Di Pierro <massimo....@gmail.com> 
> > > > > > > wrote: 
> > 
> > > > > > > > Not many changes but lots of small bug fixes that make things 
> work 
> > > > > > > > better. 
> > > > > > > > generic fields are now disabled by default for old app and 
> only 
> > > > > > > > enabled on localhost for new apps. 
> > > > > > > > This is a security improvement that was discussed extensively 
> here, 
> > > > > > > > was release in 1.96.x but was still not working as it should 
> have. 
> > 
> > > > > > > > Please upgrade and report any bug. 
> > 
> > > > > > > > massimo

Reply via email to