in dev.cfg
sqlalchemy.dburi = 'mysql://maindb/myapp'
sales.dburi = 'oracle://extserver/oldapp'
and then bind_meta_data? Does this function ONLY binds sqlalchemy.dburi?
or
in model.py
from turbogears.database import metadata
sales_metadata = MetaData('oracle://extserver/oldapp')
or can I call it this way?
sales_metadata = MetaData(sales.dburi) If I defined it in dev.cfg?
mytbl = Table('mytbl', metadata, # Creates in main db
...
tbl2 = Table('tbl2', sales_metadata, # Creates in sales db
...
Lucas
I have multi-client apps (even changing the stylesheets applied to the
templates) but I used cookies for determining which client is accessing the
application and I have the client coded at the DB tables, i.e., something
differentiates a row from one client of a row from another client.
Going this route allowed me using TG as it is, without any monkeypatch or
change, and also allows me to get the most from the database, even sharing
common information among several clients.
If you use PostgreSQL, I'd suggest using multiple schemas and using the search
path to find the tables you want, then you can easily change things by simply
changing the search path.
--
Jorge Godoy <jgo...@gmail.com>