orm.with_polymorphic() does not load columns of descendant classes

Issue #3158 resolved
Gabor Gombas
created an issue


The documentation of orm.with_polymorphic() says:

Using this method will ensure that each descendant mapper’s tables are included in the FROM clause, and will allow filter() criterion to be used against those tables. The resulting instances will also have those columns already loaded so that no “post fetch” of those columns will be required.

However, that does not seem to be the case in the attached example - the subquery does load b.prop, but the top level query does not, so accessing it still generates an extra query.

Comments (3)

  1. Log in to comment