On 6/18/15 1:20 PM, Richard Gerd Kuesters wrote:
hello all! i think this is a quick question: is there a way to get the
referencing table and column from a given foreign key column, rather
then "list(col.impl.parent_token.expression.foreign_keys)[0]" ?
You can call the .foreign_keys accessor straight off the mapped attribute:
>>> B.a_id.foreign_keys
set([ForeignKey('a.id')])
in relational DBs there is of course no "the" referencing table because
a column can be referenced, or reference, multiple constraints / columns
/ tables.
best regards,
richard.
--
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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
--
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/d/optout.