[sqlalchemy] How to find the local column name given a ForeignKey object?

2013-10-03 Thread tiadobatima
Hello there, I'm wondering if there is an easy way of finding the local column name given a ForeignKey. For example, the snippet below just gives me the remote column name: for fkey in meta.tables['mytable'].foreign_keys: print fkey.column I understand I could iterate over all the columns

Re: [sqlalchemy] How to find the local column name given a ForeignKey object?

2013-10-03 Thread Michael Bayer
ForeignKey has .column as the column it refers to, and .parent as the column that is constrained to that .column. On Oct 3, 2013, at 3:18 PM, tiadobatima gbara...@gmail.com wrote: Hello there, I'm wondering if there is an easy way of finding the local column name given a ForeignKey. For

Re: [sqlalchemy] How to find the local column name given a ForeignKey object?

2013-10-03 Thread tiadobatima
Great! Exactly what I was looking for :) Thank you very much! g. On Thursday, 3 October 2013 14:02:58 UTC-7, Michael Bayer wrote: ForeignKey has .column as the column it refers to, and .parent as the column that is constrained to that .column. On Oct 3, 2013, at 3:18 PM, tiadobatima