- attached test_mapper.py
MapperExtension not being applied when assigned to query via options method
Issue #454
resolved
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)
-
Account Deleted -
repo owner - changed status to resolved
fixed in changeset:2332. your test needs a
session.clear()
before thequery
so that thepopulate_instance
gets called on the select (otherwise it uses the existing instances from the session). -
repo owner - removed milestone
Removing milestone: 0.3.4 (automated comment)
- Log in to comment
Test case for mapper extension