On Jul 25, 2013, at 3:00 PM, Gerald Thibault <[email protected]> wrote:

> If I define a Column like so (declarative syntax):
> 
> location_id = Column(Integer, ForeignKey(Location.id))
> 
> How do I access that foreign key when I have the location_id attribute? I 
> looked through the source a bit, and it kind of looks like it never actually 
> creates a relationship pointing from the column to the fk, only the other way 
> around (via 'parent'). Is this even possible?


Column and ForeignKey are commonly prerequisites for the usage of 
relationship() but they do not imply the production of a relationship() object, 
unless you are using some specialized extensions which perform this task 
outside of SQLAlchemy.    At the Core, the foreign key references associated 
with a Column object are in the foreign_keys collection:  
location_id.foreign_keys.

-- 
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