15 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: Is there a way to re...
FromSent OnAttachments
Denis S. Otkidach26 Dec 2007 09:12 
Michael Bayer26 Dec 2007 11:38 
Denis S. Otkidach27 Dec 2007 01:11 
Michael Bayer27 Dec 2007 13:58 
Rick Morrison27 Dec 2007 13:59 
braydon fuller27 Dec 2007 15:01 
Rick Morrison27 Dec 2007 15:06 
Denis S. Otkidach28 Dec 2007 02:49 
Michael Bayer28 Dec 2007 07:25 
Denis S. Otkidach11 Jan 2008 09:30 
Michael Bayer11 Jan 2008 09:41 
Denis S. Otkidach15 Jan 2008 05:20 
Michael Bayer15 Jan 2008 07:54 
Denis S. Otkidach16 Jan 2008 01:43 
Michael Bayer16 Jan 2008 08:41 
Subject:[sqlalchemy] Re: Is there a way to replace object in DB?
From:Michael Bayer (mike@zzzcomputing.com)
Date:12/28/2007 07:25:34 AM
List:com.googlegroups.sqlalchemy

On Dec 28, 2007, at 5:50 AM, Denis S. Otkidach wrote:

Sure, I can get an object from DB and copy data from new one. But there is a lot of object types, so have to invent yet another meta description for it (while it already exists in sqlalchemy). And requirements changes often, so I have to change scheme in 2 places. This is not good and error prone. Why I have to invent new description when there is already one from sqlalchemy mapping? Can't I use it for my purpose? Something like merge(objFromDB, newObj) will solve the problem.

session.merge() does copy the attributes of one object into another. theres some bugs with dont_load that have been fixed in trunk so try out the trunk if you have problems.