You can simplify maintenance somewhat on Linux or Mac by soft linking model 
files.

First off, figure out which application is going to own the shared tables. 
 Put the shared tables in one model file in that applications models 
directory.

At the top of the model file do something like this:
mymigrate = False
if request.application=='app_that_owns_the_table':
  mymigrate = True


Then in each table you can do:
db.define_table(
    ...
    migrate=mymigrate
)


You also could do something similar for Anthony's suggestion, quoted here:
db = DAL(..., migrate_enabled=False)


On Sunday, November 25, 2012 5:27:17 PM UTC-5, pumplerod wrote:
>
> Sorry, I'm a little unclear on the manual explanation.
>
> as an example, given app1 and app2
>
> I want to have app2 share the database I have built in app1
>
> So do I change the app2/models/db.py file to show: db = 
> DAL('sqlite://storage.sqlite',migrate='false')  ?
>
> and include all other myModel.py files in app2/models directory as well?
>
> if the database is in app1/databases/ how does app2 know how to find the 
> correct database file?
>

-- 



Reply via email to