implement polymorphic get()-like behavior for concrete inheritance

Issue #678 resolved
Mike Bayer repo owner created an issue

currently, get() from the base mapper in concrete inheritance needs to issue a query in all cases; instance keys still use the actual class in their tuple so get() from the base mapper can never identify the object by instance key.

a composite-PK approach needs to be built into concrete such that the polymophic_on column is added to their PK; but also such that get() on query adds this value in automatically when its known.

Comments (2)

  1. Mike Bayer reporter

    this ticket makes no sense at all. what does :

    sess.query(SomeBaseClass).get(5)
    

    return ? id #5 could be in any or all of each concrete table. thats just a fact of how this works - with concrete you need to know the type. explicitly putting the polymorphic identity in the get() pk argument is redundant vs. just specifying the Query against the correct subtype.

  2. Log in to comment