Hi,

Say I have two different files that I import that establish tables via
declarative_base, so

import a, b

where there exists a.Group and b.User and then I create my engine

engine = create_engine(...)

and then I ..

a.metadata.bind = engine
b.metadata.bind = engine

or I could call create_all(engine) or whatever. But what I want to do
is create a many-to-many table called group_users and set ..

a.User.groups = relation('Group', secondary=group_users,
backref='user')
b.Group.users = relation('User', secondary=group_users,
backref='group')

and right now i do this by creating a third metadata that i bind to
engine. But unfortunately its not aware of either tables from the
first two metadatas that ive imported.

Is there a way that I can merge all metadata's? Or make my relational
metadata aware of the tables in the first two?

Thanks,
Daniel
--~--~---------~--~----~------------~-------~--~----~
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