On 8/24/2010 9:47 PM, Michael Bayer wrote:
Michael Hipp wrote:
How do I make a copy of an orm object such that modifications to the
copy do not affect the original?

     x = MyObject()
     for a in dir(myoldobject):
         if not a.startswith('_'):
             setattr(x, a, getattr(myoldobject, a))

Thank you. That's perfect - and worthy of being captured somewhere it can be reused.

I apologize for wasting your time with a poorly worded question.

Thanks,
Michael

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

Reply via email to