Update to question 2: PUT works now, but DELETE doesn't. I get the 
following error:

 <type 'exceptions.TypeError'> not indexable

web2py™ Version 
 2.6.3-stable+timestamp.2013.09.15.17.01.20Python  Python 2.7.4: 
/usr/bin/python (prefix: /usr)  Traceback (most recent call last):  
  File "../gluon/restricted.py", line 217, in restricted  
    exec ccode in environment  
  File "../applications/app/controllers/default.py", line 103, in <module>  
  File "../gluon/globals.py", line 378, in <lambda>  
    self._caller = lambda f: f()  
  File "../gluon/globals.py", line 348, in f  
    raise e  TypeError: not indexable




El lunes, 16 de septiembre de 2013 16:44:10 UTC+3, Dimid Korovev escribió:
>
> Hi All,
>
> I heard about web2py following this question:
>
> http://stackoverflow.com/questions/5899483/generate-rest-based-service-from-database-schema
>
> My goal is to create a RESTful web service from a DB, such that when the 
> DB is modified, no code changes would be needed.
>
> Questions:
> 1. When creating the DB schema to be extracted, should I add an 'id' 
> field? If I do, the resulted 'legacy_db_web2py_code' string contains an 
> 'ID' field in 'define_table'. However, the documentation says such field is 
> already created implicitly. If I don't, I need another PK to create 
> relations with foreign keys.
>
> 2. I've found an example here:
>
> http://www.web2pyslices.com/slice/show/1534/restful-services-with-curl-andor-python
>
> but PUT and DELETE won't work (GET and POST do work). any suggestions?
>
> 3.I've written a small scitpt (attached) which wraps 
> 'extract_mysql_models'. Feedback would be welcomed.
>
> Thanks in advance
>

-- 
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/groups/opt_out.

Reply via email to