interpret primaryjoin where the actual FK/PK column is inside a binary expression or similar

Issue #2373 resolved
Andrey Popp created an issue

Currently SQLAlchemy doesn't allow to map relationships which have primaryjoin condition like this:

a.c.b_id + 2 == b.c.id

It just can't figure out the direction of relationships even if I supply a.c.b_id + 2 as foreign_keys element.

dupe of

Comments (6)

  1. Andrey Popp reporter

    Please see attached test case for more info regarding issue. I think this is good enhancement to SQLAlchemy.

  2. Andrey Popp reporter

    Attached second version of test case there foreign_keys contains column and not expression.

  3. Andrey Popp reporter

    Thanks, somehow I didn't spot _local_remote_pairs in RelationshipProperty constructors arguments.

  4. Log in to comment