[web2py] Re: RESTful interfaace

2011-10-13 Thread Arturo Filastò
On Oct 13, 1:13 pm, Arturo Filastò wrote: > When I try to use the suggested decorator I get this error: > > Traceback (most recent call last): >   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/ > lib/python2.7/gluon/restricted.py", line 192, in restricted >     exec ccode in en

[web2py] Re: RESTful interfaace

2011-10-13 Thread Arturo Filastò
When I try to use the suggested decorator I get this error: Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/ lib/python2.7/gluon/restricted.py", line 192, in restricted exec ccode in environment File "/x//x/xxx///Glo

[web2py] Re: RESTful interfaace

2011-10-12 Thread Massimo Di Pierro
Writing it It may change but not too much. On Oct 12, 7:40 pm, ~redShadow~ wrote: > On Wed, 2011-10-12 at 17:25 -0700, Massimo Di Pierro wrote: > > [..cut..] > > I've already seen this example somewhere (is it in the book?) but it > looks like the whole REST-server thing is quite undocumented

Re: [web2py] Re: RESTful interfaace

2011-10-12 Thread ~redShadow~
On Wed, 2011-10-12 at 17:25 -0700, Massimo Di Pierro wrote: > [..cut..] I've already seen this example somewhere (is it in the book?) but it looks like the whole REST-server thing is quite undocumented and not advertised as it should.. is that just experimental and might change in the future? Or,

[web2py] Re: RESTful interfaace

2011-10-12 Thread Massimo Di Pierro
You can do: @request.restful() def api(): response.view = 'generic.json' def GET(tablename,id): if not tablename=='person': raise HTTP(400) return dict(person = db.person(id)) def POST(tablename,**fields): if not tablename=='person': raise HTTP(400) retu