From b1a956d4210c2bb06051a4a8b0d2e75d7c471ecd Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 26 Sep 2014 12:50:18 -0400 Subject: [PATCH] - add explicit warning re: polymorphic_on, cascading is not supported at this time. ref #3214 --- doc/build/orm/inheritance.rst | 6 ++++++ lib/sqlalchemy/orm/mapper.py | 6 ++++++ 2 files changed, 12 insertions(+) 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` -- 2.47.2