On Feb 6, 2008, at 9:43 PM, Richard Levasseur wrote:

> I also noticed that you can't change the 'type' column, it'll insert
> whatever value identifies it from the mapper (makes sense, though),
> and ignores it during updates.  Whats not clear is how do I change the
> type, period?  Creating a new child instance and setting its id's to
> the parent's doesn't work ("conflicts with persisted instance").  Are
> my bleary eyes missing something?

we dont yet support a "seamless" change of inheriting type.  your best  
bet is to issue the SQL to the table directly which changes the  
polymorphic value to the new value, then inserting/deleting from the  
child tables as needed..then reload the object into your session (i.e.  
expunge() the old one first).

the reason its not yet supported is because the extra steps of  
INSERTing and/or DELETEing in conjunction with what would normally  
just be an UPDATE are a little complex...also we'd have to pick an API  
for this (like, myobject = session.change_type(myobject, FooClass) ?   
not sure).  but we'll get this in there sooner or later (sooner if its  
an urgent need for people). 
  

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to