On 8/17/06, Grzesiek Slusarek <[EMAIL PROTECTED]> wrote: > Hello all. > I have some question is it possible to do something like this by > sqlalchemy: > I have some database instances (e.g. 3) which table users (the > structure os table users is identical on this 3 database instances). > Is it possible to mapp this 3 tables to one Python object like Users > ??
That sounds to me like a recipe for trouble, unless you can *guarantee* that the user ID's are different between the databases. Otherwise, here's a Python object with user_id 1. Which database did it come from? How do you know? However, if you really want to try this, I'd take a look at http://www.sqlalchemy.org/docs/metadata.myt, especially the difference between BoundMetaData and DynamicMetaData objects. By creating three engines corresponding to your three databases, and using the connect() method DynamicMetaData to cycle between them, you should be able to do something like what you want. I'm afraid I can't give you any more details, though, since I've never tried this. Hopefully this will be enough to get you pointed in the right direction. -- Robin Munn [EMAIL PROTECTED] GPG key 0xD6497014 ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

