From: Mike Bayer Date: Thu, 2 Nov 2017 17:40:43 +0000 (-0400) Subject: - cross-link of_type() correctly X-Git-Tag: rel_1_2_0~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d1a718214eb67d3bd25d62ae1570b09a7a22993;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - cross-link of_type() correctly Change-Id: Iaacab5d2fe45b0b87fea922ec914e258dba9e30d --- diff --git a/doc/build/orm/inheritance_loading.rst b/doc/build/orm/inheritance_loading.rst index 6f41f43e61..34741d82a5 100644 --- a/doc/build/orm/inheritance_loading.rst +++ b/doc/build/orm/inheritance_loading.rst @@ -547,6 +547,7 @@ set up, we could get the same result as follows:: s.query(Employee).options( selectin_polymorphic(Employee, [manager_poly])).all() +.. _inheritance_of_type: Referring to specific subtypes on relationships ----------------------------------------------- diff --git a/lib/sqlalchemy/orm/interfaces.py b/lib/sqlalchemy/orm/interfaces.py index 84b5f6cc7a..003be53338 100644 --- a/lib/sqlalchemy/orm/interfaces.py +++ b/lib/sqlalchemy/orm/interfaces.py @@ -404,6 +404,9 @@ class PropComparator(operators.ColumnOperators): :param \class_: a class or mapper indicating that criterion will be against this specific subclass. + .. seealso:: + + :ref:`inheritance_of_type` """ diff --git a/lib/sqlalchemy/orm/relationships.py b/lib/sqlalchemy/orm/relationships.py index 16e1cdb97d..8cb25ea96f 100644 --- a/lib/sqlalchemy/orm/relationships.py +++ b/lib/sqlalchemy/orm/relationships.py @@ -963,11 +963,9 @@ class RelationshipProperty(StrategizedProperty): return pj def of_type(self, cls): - """Produce a construct that represents a particular 'subtype' of - attribute for the parent class. + r"""Redefine this object in terms of a polymorphic subclass. - Currently this is usable in conjunction with :meth:`.Query.join` - and :meth:`.Query.outerjoin`. + See :meth:`.PropComparator.of_type` for an example. """ return RelationshipProperty.Comparator(