lazy loader of *toOne fires SQL even if instance is already in memory, if joined on joined-table inh foreign key

Issue #1186 resolved
Former user created an issue

there is A1 inheriting A0, and having relation onetomany to B.a. for b in query(B).filter(B.a == mya): print b.a fires SQL. it compares (PropLoader.Init()): "A0".db_id = ? ? = "A1".db_id and they are not deemed quivalent while they should for the needs of the prop.

Comments (5)

  1. Mike Bayer repo owner
    • changed milestone to 0.6.0

    I've been working around this one using:

    mapper_A1.add_property( 'bs', relation( B,
                backref= backref('ax', primaryjoin=table_A0.c.db_id==table_B.c.ax_id, foreign_keys=table_B.c.ax_id),
                lazy= True,
                uselist= True,
                ) )
    

    but not for long ....

  2. Log in to comment