Re: [sqlalchemy] orm object, before after

2010-10-16 Thread Michael Hipp
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? The mapped object has a member _sa_instance_state that you basically don't want to transfer to your new object.You want it

Re: [sqlalchemy] orm object, before after

2010-10-16 Thread Michael Bayer
On Oct 16, 2010, at 1:02 PM, Michael Hipp wrote: 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? The mapped object has a member _sa_instance_state that you basically don't

Re: [sqlalchemy] orm object, before after

2010-10-16 Thread Michael Hipp
On 10/16/2010 12:52 PM, Michael Bayer wrote: On Oct 16, 2010, at 1:02 PM, Michael Hipp wrote: 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? The mapped object has a member

Re: [sqlalchemy] orm object, before after

2010-10-16 Thread Michael Bayer
On Oct 16, 2010, at 2:03 PM, Michael Hipp wrote: On 10/16/2010 12:52 PM, Michael Bayer wrote: On Oct 16, 2010, at 1:02 PM, Michael Hipp wrote: 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

Re: [sqlalchemy] orm object, before after

2010-10-16 Thread Michael Hipp
On 10/16/2010 1:55 PM, Michael Bayer wrote: On Oct 16, 2010, at 2:03 PM, Michael Hipp wrote: On 10/16/2010 12:52 PM, Michael Bayer wrote: On Oct 16, 2010, at 1:02 PM, Michael Hipp wrote: On 8/24/2010 9:47 PM, Michael Bayer wrote: Michael Hipp wrote: How do I make a copy of an orm object

Re: [sqlalchemy] orm object, before after

2010-10-16 Thread Michael Bayer
On Oct 16, 2010, at 4:02 PM, Michael Hipp wrote: On 10/16/2010 1:55 PM, Michael Bayer wrote: On Oct 16, 2010, at 2:03 PM, Michael Hipp wrote: On 10/16/2010 12:52 PM, Michael Bayer wrote: On Oct 16, 2010, at 1:02 PM, Michael Hipp wrote: On 8/24/2010 9:47 PM, Michael Bayer wrote:

Re: [sqlalchemy] orm object, before after

2010-08-25 Thread Michael Hipp
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,

[sqlalchemy] orm object, before after

2010-08-24 Thread Michael Hipp
I'm holding an orm object that will have changes made to it. Once done it will be passed to the business logic layer that will have to make decisions from the before and after state of the object... What's the best way to get an object, save its state ('before'), modify it ('after) without

Re: [sqlalchemy] orm object, before after

2010-08-24 Thread Michael Bayer
On Aug 24, 2010, at 2:08 PM, Michael Hipp wrote: I'm holding an orm object that will have changes made to it. Once done it will be passed to the business logic layer that will have to make decisions from the before and after state of the object... What's the best way to get an object,

Re: [sqlalchemy] orm object, before after

2010-08-24 Thread Michael Hipp
On 8/24/2010 1:51 PM, Michael Bayer wrote: On Aug 24, 2010, at 2:08 PM, Michael Hipp wrote: I'm holding an orm object that will have changes made to it. Once done it will be passed to the business logic layer that will have to make decisions from the before and after state of the object...

Re: [sqlalchemy] orm object, before after

2010-08-24 Thread Michael Bayer
Michael Hipp wrote: On 8/24/2010 1:51 PM, Michael Bayer wrote: On Aug 24, 2010, at 2:08 PM, Michael Hipp wrote: I'm holding an orm object that will have changes made to it. Once done it will be passed to the business logic layer that will have to make decisions from the before and after