From: Mike Bayer Date: Fri, 26 Sep 2014 16:50:18 +0000 (-0400) Subject: - add explicit warning re: polymorphic_on, cascading is not supported X-Git-Tag: rel_1_0_0b1~70^2~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1a956d4210c2bb06051a4a8b0d2e75d7c471ecd;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - add explicit warning re: polymorphic_on, cascading is not supported at this time. ref #3214 --- diff --git a/doc/build/orm/inheritance.rst b/doc/build/orm/inheritance.rst index 642f3420c2..9f01a3e24f 100644 --- a/doc/build/orm/inheritance.rst +++ b/doc/build/orm/inheritance.rst @@ -45,6 +45,12 @@ this column is to act as the **discriminator**, and stores a value which indicates the type of object represented within the row. The column may be of any datatype, though string and integer are the most common. +.. warning:: + + Currently, **only one discriminator column may be set**, typically + on the base-most class in the hierarchy. "Cascading" polymorphic columns + are not yet supported. + The discriminator column is only needed if polymorphic loading is desired, as is usually the case. It is not strictly necessary that it be present directly on the base mapped table, and can instead be defined on a diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index eaade21ecb..2ab239f862 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -426,6 +426,12 @@ class Mapper(InspectionAttr): thus persisting the value to the ``discriminator`` column in the database. + .. warning:: + + Currently, **only one discriminator column may be set**, typically + on the base-most class in the hierarchy. "Cascading" polymorphic + columns are not yet supported. + .. seealso:: :ref:`inheritance_toplevel`