> question. > > Lets say I have a series of table definitions, and a series of > objects linked to the tables with a bunch of mappers. > > First question: Is there a way to get from the table definitions > in the metadata to the Mapper? For simple table==class, the link is 1:1. For multi-table-inheritances/ single-inheritances, it's many:1.
And the linking is mostly the other way (mapper-to-tables, not tables-to-mappers), so u may have to dig: u can use either m=class_mapper( yourclas) or m=object_mapper( obj); then check isinstance( m.localtable, Table), and use it... all mappers are in mapper_registry... but this is all pure gymnastics... > Second question: If I create a MapperExtension, can I then link it > to the mapper associated with a table? themapper.extension = yours... ; or see global_extensions. dontknow about their compilation though... > What I want to do is create a simple application that goes through > the tables defined within a metadata, and create an extension so > that every time a table entry is added it prints 'hello world' to > the screen. > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---