many-to-one relationship interpretation by query

Issue #2846 new
Mike Bayer repo owner created an issue

consolidating #1328, #2797, #2845 as these are all dealing with the same thing from different angles.

SomeClass.some_m2o, which refers to OtherEntity as a many-to-one, would be interpreted:

  1. for sess.query(SomeClass.some_m2o) as sess.query(OtherEntity)

  2. for sess.query(SomeClass).filter(SomeClass.some_m2o == OtherEntity) as filter(SomeClass.other_entity_id == OtherEntity.id)

  3. for sess.query(SomeClass).order_by(SomeClass.some_m2o), group_by(SomeClass.some_m2o), as order_by/group_by SomeClass.other_entity_id

  4. as is currently the case, sess.query(SomeClass).filter(SomeClass.some_m2o == other_entity) compares to other_entity.id

any other query.something(SomeClass.m2o..something) type requests should get put here.

Comments (4)

  1. Mike Bayer reporter
    • edited description
    • changed milestone to 1.0

    lets try for this one on the next big release though I continue to not care too much about this myself

  2. Log in to comment