On Dec 10, 2013, at 5:04 PM, Iain Duncan <iainduncanli...@gmail.com> wrote:

> Hi, I'm stuck on how to do something that I'm sure must be possible.
> 
> I have two kinds of records, using table inheritance, Client, and 
> SpecialClient. SpecialClient has extra fields and it's own polymorphic 
> identity. I need to *promote* a and existing client record to a special 
> client. I tried just making a SpecialClient and copying over attributes, but 
> this is giving me "can't set attribute" error messages. Can anyone tell me 
> what the *right* way to do change a polymorphic type, while keeping it's ID 
> the same, would be? In my case, the ID in the derived type is an fkey to the 
> base type table's id col.

if its joined inheritance, you have to INSERT into the new table manually, that 
feature isn’t supported right now.   if it’s single, try emitting an UPDATE for 
the “discriminator” column, then reloading the object.




> 
> Thanks!
> Iain
> 
> -- 
> 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 sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to