Re: [web2py] Re: REST the web2py way - RFC

2011-03-21 Thread Tom Atkins
this may be of interest: http://stackoverflow.com/questions/5050481/restful-backend-framework-for-backbone-js-and-co

[web2py] Re: REST the web2py way - RFC

2011-03-14 Thread Massimo Di Pierro
Patterns can be farily complex. Assuming db.define_table('person',Field('name')) db.define_table('pet',Field('owner',db.person),Field('name'),Field('info')) you can do patterns = [ '/person-by-id/{person.id}', '/person-by-id/{person.id}/:field',

[web2py] Re: REST the web2py way - RFC

2011-03-13 Thread Massimo Di Pierro
Because I would know how to do @request.get() def api(): return dict() @request.post() def api(): return dict() i.e. have two functions with the same name and select one or the other without ambiguity. On Mar 13, 9:04 am, contatogilson...@gmail.com contatogilson...@gmail.com wrote: Would not

Re: [web2py] Re: REST the web2py way - RFC

2011-03-13 Thread contatogilson...@gmail.com
Or it may be well: @request.get() @request.post() def api(): return dict() As he is a decorator, avoid ambiguities and thus would be more clear the code. _ *Gilson Filho* *Web Developer http://gilsondev.com* 2011/3/13 Massimo Di Pierro

[web2py] Re: REST the web2py way - RFC

2011-03-13 Thread mart
this is interesting... I added the function in a app's default controller, the did this: for x in [item.strip().split('/') for item in urllib2.urlopen('http:// 127.0.0.1:8000/appRM/default/api/list.json')]: for item in [string.strip(y,', ') for y in x[1:-1]]: