]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- The :meth:`.PropComparator.of_type` modifier has been
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 24 Nov 2014 23:49:32 +0000 (18:49 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 24 Nov 2014 23:49:32 +0000 (18:49 -0500)
commitde11f9498258182cbb6668b72067ec3f43a90415
treed5d8aba789516b02391fa38d14085709ef86aca3
parentba926a09b493b37c88e7b435aaccc6b399574057
- The :meth:`.PropComparator.of_type` modifier has been
improved in conjunction with loader directives such as
:func:`.joinedload` and :func:`.contains_eager` such that if
two :meth:`.PropComparator.of_type` modifiers of the same
base type/path are encountered, they will be joined together
into a single "polymorphic" entity, rather than replacing
the entity of type A with the one of type B.  E.g.
a joinedload of ``A.b.of_type(BSub1)->BSub1.c`` combined with
joinedload of ``A.b.of_type(BSub2)->BSub2.c`` will create a
single joinedload of ``A.b.of_type((BSub1, BSub2)) -> BSub1.c, BSub2.c``,
without the need for the ``with_polymorphic`` to be explicit
in the query.
fixes #3256
doc/build/changelog/changelog_10.rst
doc/build/orm/inheritance.rst
lib/sqlalchemy/orm/strategy_options.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/util/_collections.py
test/base/test_utils.py
test/orm/test_of_type.py