diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-26 12:50:18 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-26 12:50:18 -0400 |
commit | b1a956d4210c2bb06051a4a8b0d2e75d7c471ecd (patch) | |
tree | 296ff606282d6f9f3eb7f85f730ed2389526bd63 | |
parent | cb0c1eda24e1546fcdc9b4e46adc1c5fb14b60d0 (diff) | |
download | sqlalchemy-b1a956d4210c2bb06051a4a8b0d2e75d7c471ecd.tar.gz |
- add explicit warning re: polymorphic_on, cascading is not supported
at this time. ref #3214
-rw-r--r-- | doc/build/orm/inheritance.rst | 6 | ||||
-rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/build/orm/inheritance.rst b/doc/build/orm/inheritance.rst index 642f3420c..9f01a3e24 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 eaade21ec..2ab239f86 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` |