Hi,

That's one way, but I'd suggest a different approach. How about having 
separate models that are bound to different databases. You then just use 
the classes you need to, without further trouble.

BTW, we may have quite different use cases. I have one primary database 
that I control and holds most of the data. There's a second database, 
controlled by a different department, that I need to access just 
occasionally. Potentially in the future there could be more of these.

What's you use case?

There is something of an issue with TG's automatic transaction - how 
does this scale to many databases? Also, what about requests that do no 
database operations - do they still cause communication with the 
database? I wonder, for SQLAlchemy, is it better just to have a 
unit-of-work session, but no transaction? I may pass this question to 
Mike Bayer.

Paul


Ian Charnas wrote:

>I think we're moving towards the ability to support multiple apps and
>multiple engines in any configuration, something similar to what
>Alberto just posted:
>http://paste.turbogears.org/paste/1266
>
>In order to have the most flexibility, I think we should treat the
>database like we treat the template....  I think that expose() should
>take a "dburi" parameter just like it takes a "template" parameter,
>and I think that an exposed method should be able to return "dburi" as
>a key in the returned dictionary to override the one passed in through
>the expose() decorator.  Also by default (if no dburi is specified by
>the exposed method) we'll want to use the dburi found in the
>sqlalchemy.dburi config parameter, in order to support legacy sites
>and simple sites that only need one engine.  It's not difficult to do
>this for both sqlalchemy and sqlobject, although thinking ahead it may
>be difficult to use *both* on the same site without introducing a
>clumsy hack somewhere so each dburi also says which ORM to use.
>
>Thoughts, anyone?  Does this sound like a clean way to handle this at
>a framework level?
>
>
>>
>
>  
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to