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 <[email protected] <javascript:>> 
> wrote:
>
> 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 of the local table to 
> find which has a foreign key, but I imagine there is a more direct way.
>
> Thanks! :)
> g.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected]<javascript:>
> .
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to