]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- cross-link of_type() correctly
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 2 Nov 2017 17:40:43 +0000 (13:40 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 2 Nov 2017 17:40:43 +0000 (13:40 -0400)
Change-Id: Iaacab5d2fe45b0b87fea922ec914e258dba9e30d

doc/build/orm/inheritance_loading.rst
lib/sqlalchemy/orm/interfaces.py
lib/sqlalchemy/orm/relationships.py

index 6f41f43e61a21e60b77e618232fe337e6bbe8cc6..34741d82a557603b92fb63d75d290dfd4c1543bc 100644 (file)
@@ -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
 -----------------------------------------------
index 84b5f6cc7a3c3ade07ae4697eec5e1136b3ba15d..003be53338f90ff9fd516856461924d498470b8a 100644 (file)
@@ -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`
 
         """
 
index 16e1cdb97dcbabbb48a06d2479e0a3c87dd338a6..8cb25ea96fe19893b44764ce954428c26ab5ef8b 100644 (file)
@@ -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(