Thanks Alan.

Could you give an example how to share db.py and other function under 
models/ folder (say menu.py) across applications?





On Tuesday, July 30, 2013 12:16:17 PM UTC-7, Alan Etkin wrote:
>
> You can share the schema across different apps by serving and requesting 
> it in json or yaml format:
>
> Is there a way we could share these things (db.py models and modules 
>> across applications?)
>>
>> Currently we share databases across applications. IT is a bit tedious to 
>> copy schema definitions to many applications.
>>
>
> # sanitize set to False preserves the uri string
> data = db.as_json(sanitize=False)
>
> At the client side you can then restore it with
>
> from gluon.serializers import loads_json
> schema = loads_json(data)
> db = DAL(schema)
>
> The Table class also supports similar methods to export a subset of the 
> table definitions
>
> EDIT: If your apps share the server, then you could just share a module 
> with the table definitions:
>
>
> http://www.web2pyslices.com/slice/show/1479/model-less-apps-using-data-models-and-modules-in-web2py
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to