On May 8, 2013, at 3:24 PM, sajuptpm <[email protected]> wrote:

> Hi Michael Bayer,
> 
> 1)
> I tried your suggestion, but it not updating the value of "type" column in 
> the database.
> instance_of_B.__class__ = C_Class
> instance_of_B.type = "type_c"
> 
> 2)
> * So, i tried like this, and it updating he value of "type" column in the 
> database.
> * What you think?, is it a good way to solve this issue ?


the solution I gave requires SQLAlchemy 0.7 or greater.    I'm now recalling 
you said you're stuck on very old 0.5 versions, so yes, do whatever works.



> 
> zope transaction begin
> Some DBSession query and add statements
> 
> DBSession.execute("update my_table set type='%s' where id='%s';" %(new_type, 
> id))
> DBSession.execute("commit;")
> 
> Some DBSession query and add statements
> zope transaction commit
> 
> Thanks,
> 
> 
> -- 
> 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 http://groups.google.com/group/sqlalchemy?hl=en.
> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to