On Tue, Dec 10, 2013 at 3:54 PM, Michael Bayer <mike...@zzzcomputing.com>wrote:
> > 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. > > I think it's joined inheritance? The derived table's primarky key is an "id" column that is also an fkey to the base table's "id" column and the base table has a "_type" column holding the poly id. Does this mean I should drop into sql directly to create the record in the derived table and it will "just work"? thanks Michael! iain > > > > > 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. > > > -- 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.