I did just that this afternoon to link across heterogeneous
dataservers. Modulo the inevitable awkwardness from having two
different names for the same thing (i.e. Asset and EjvAsset), this was
very easy:

class_mapper(Asset).add_properties({
   'EjvAsset' : relation(EjvAsset,
                         primaryjoin=Asset.asset_id ==
EjvAsset.asset_id,
                         foreign_keys=[Asset.asset_id],
                         viewonly=True,
                         ),
   })

very neat!


pjjH



On Apr 16, 10:57 am, Michael Bayer <mike...@zzzcomputing.com> wrote:
> On Apr 16, 2009, at 10:50 AM, JanW wrote:
>
>
>
> > OK, thanks, so does that mean that mapping one class against multiple
> > tables in different databases is something very exotic and probably
> > bad practice?
>
> its an impossible practice unless you're usingDBLINK...
>
>
>
> > Or is there some elegant way to achieve this?
>
> map a class to each table and use a relation() between them to load  
> from one, then the other.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to