self-referential relations using multi-column foreign keys where at least 1 column of the foreign key is also a primary key don't work

Issue #1448 resolved
Former user created an issue

The code in sqlalchemy/orm/properties.py chooses the wrong direction for multi-column, self-referential foreign keys which share columns with the primary key. It chooses ONETOMANY because there is at least 1 foreign key column which is also a primary key. The attached patch changes the logic to only choose ONETOMANY if all foreign key columns are primary key columns.

Comments (1)

  1. Log in to comment