this is a long ago "wontfix" as it's something you can do manually if
you really need to:
https://bitbucket.org/zzzeek/sqlalchemy/issues/648/support-for-casting-superclass-to
specifically with joined-table inheritance, changing the class of an
object means you need to INSERT/DELETE from the appropriate joined
tables individually.
if you've worked up recipes that do what you need, then you are good.
as far as "polymorphic identity", this is settable on a class but IMO if
you really want to "change the class" you should write a recipe that
emits the core INSERT/UPDATE/DELETE statements directly, then reload the
object into the ORM.
On 05/11/2017 09:40 AM, [email protected] wrote:
Hello,
i have posted a question in stackoverflow around updating a db model
attribute determining polymorphic identity and also triggering
validations for new subclass before allowing the change. I am wondering
if this is ideologically right. Could you please comment:
https://stackoverflow.com/questions/43917007/sqlalchemy-change-polymorphic-identity
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and
Verifiable Example. See http://stackoverflow.com/help/mcve for a full
description.
---
You received this message because you are subscribed to the Google
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.