I must be missing something simple: i have looked in:
- orm.properties.ColumnProperty (which i iterate by name using mapper.iterate_properties); couldn't find anything about foreign keys or the originating Column - Column (iterate via class.__table__.c); can see whether it is a Foreign key, but not always the name of the column - class.__dict__; cannot address the Columns by name (they are in __table__) - orm.attributes.InstrumentedAttribute via class.__dict__: could not find anything about foreign keys or related column. I am working on a way to translate SQLA objects to XML, but do not always want to include the FK's (instead include the "relationship" attribute values) What am I missing? Cheers, Lars On Mar 26, 1:29 am, lars van gemerden <[email protected]> wrote: > Hello, > > Does anyone know a way get the names of the foreign key columns of a > table, if the table/class is unknown beforehand? > > I tried with "Column.foreign_keys", which gives a set (why?) of > "ForeignKey" objects but the "name" attribute of "ForeignKey" is not > automatically set. > > Cheers, Lars -- You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en.
