[web2py] Re: applying multiple decorators in a/c/default.py

2010-05-07 Thread mdipierro
The problem is that add_team is not an action. The other problem is the order of decorators. In this case @auth.requires_login() @service.jsonrpc def add_team(name, cap): #function uses auth.user.id You register the service (jsonrpc) before requiring_login therefore login would not be used.

[web2py] Re: applying multiple decorators in a/c/default.py

2010-05-07 Thread MikeEllis
Massimo, Could you please elaborate a bit further? Is this restriction something peculiar to auth.requires_login? or service.jsonrpc? or both? Or is it something that applies to any use of multiple decorators in web2py? Thanks, Mike On May 7, 10:32 am, mdipierro wrote: > You cannot do this: >

Re: [web2py] Re: applying multiple decorators in a/c/default.py

2010-05-07 Thread Carl Roach
Excellent... thanks On 7 May 2010, at 15:32, mdipierro wrote: > You cannot do this: > > @auth.requires_login() > @service.jsonrpc > def add_team(name, cap): >#function uses auth.user.id > > but you can do > > @service.jsonrpc > def add_team(name, cap): >#function uses auth.user.id > > @a

[web2py] Re: applying multiple decorators in a/c/default.py

2010-05-07 Thread mdipierro
You cannot do this: @auth.requires_login() @service.jsonrpc def add_team(name, cap): #function uses auth.user.id but you can do @service.jsonrpc def add_team(name, cap): #function uses auth.user.id @auth.requires_login() def call(): return service() On May 7, 9:17 am, Carl wrote: >