MapperExtension not being applied when assigned to query via options method

Issue #454 resolved
Former user created an issue

If you want to create a MapperExtension, and apply it occasionally to a query, the extension is not applied if you use the options method from the query.

Example class MyExt(MapperExtension): .. do stuff...

objs=session.query(MyObj).options(extension(MyExt())).select()

The query functions properly but the extension methods are not called.

Comments (3)

  1. Mike Bayer repo owner

    fixed in changeset:2332. your test needs a session.clear() before the query so that the populate_instance gets called on the select (otherwise it uses the existing instances from the session).

  2. Log in to comment