Hmm quite the same question as David G: I use the auto pattern feature
(really nice) but I don't see how to provide an index for a resource.
Am I missing something ?
Thanks !
On Aug 9, 12:11 am, David G dgeorge.sie...@gmail.com wrote:
I have a similar question as Web2py Newbie. I want to
I have a similar question as Web2py Newbie. I want to return all the
rows from a table using a pattern like:
/myapp/api/table
I'm wondering if your answer for Newbie is specific to returning a
single comment with the id of bookmark.id? How would you code the GET
method to get all the comments?
At the moment it is:
@request.restful()
def as_rest():
def GET(*args,**vars):
patterns = ['/{bookmarks.id}',
'']
parsed = db.parse_as_rest(patterns,args,vars)
if parsed.status==200: return parsed.response.json()
else:
posts =
Then you need to call
/myapp/api/as_rest/1.json
where api is the controller, as_rest is your function, 1 is the
{bookmark.id}.
On Jun 16, 12:51 am, Web2py Newbie
swiawte...@garrifulio.mailexpire.com wrote:
At the moment it is:
@request.restful()
def as_rest():
def GET(*args,**vars):
As a follow up:
I want to use something like:
/myapp/api/show_comment/id
to show comment at id
and
/myapp/api/show_comment/
To show all comments
However, when I try this it complains (invalid arguments). I try to
test id against None, but id is apparently a server object.
Any ideas or do I just
H it seems to have just dropped my supplementary question.
Apologies if this arrives twice.
I want to do something like:
/myapp/api/get_comment/id
to return the comment at id
and
/myapp/api/get_comment/
to return a list of all comments
However, it complains when I try this (invalid
Apparently: wait for a pattern failure and work with that?
if parsed.status==200: return parsed.response.json()
else:
maybe some test for kind of parse error
print out the whole
please show us your code.
On Jun 15, 2:25 am, Web2py Newbie
swiawte...@garrifulio.mailexpire.com wrote:
As a follow up:
I want to use something like:
/myapp/api/show_comment/id
to show comment at id
and
/myapp/api/show_comment/
To show all comments
However, when I try this it complains
8 matches
Mail list logo