clear enough, thx anthony. in another thread, you said :
As for @request.restful, it may be a bit slower because the decorator
involves some additional logic, but most of the time will probably be spent
on the select and the serialization anyway.
*ref*:
https://groups.google.com/forum/#!topic/web2py/fDi2hVlP6NY
is it better to separate the restful function (post, get, update, delete)
or not?
*e.g.*
@request.restful()
def parse_as_rest():
response.view = 'generic.' + request.extension
def POST(table_name, **vars):
return dict(db[table_name].validate_and_insert(**vars) )
return locals()
*change into*
def post():
table_name = request.args(0)
# don't know how to pass the **vars
return dict(db[table_name].validate_and_insert(**vars) )
*expectation* :
curl -X POST -i -d "name=name0&field=field0" http:
//127.0.0.1:8000/test/api/post/table_name.json
can work
any idea for that case (change the function from restful into default
web2py function)?
thx and best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.