Re: [sqlalchemy] Re: Mechanism of reconciling for merge method

2014-07-18 Thread Simon King
I'm not certain of the answer to that - the easiest thing is probably just to try it. Remember that session.merge() doesn't modify the instance that you pass in - it returns a different instance associated with the target session, so code normally looks more like this: u_source = User(id=1)

[sqlalchemy] Re: Mechanism of reconciling for merge method

2014-07-17 Thread Bao Niu
Probably what is abstruse here is the jargon emitting history events, is it something as a newbie must understand in order to use Session properly? As a beginner should I know this before studying Session section? I'd appreciate some insight from pros. Thanks. On Tuesday, July 15, 2014 5:57:59

Re: [sqlalchemy] Re: Mechanism of reconciling for merge method

2014-07-17 Thread Simon King
SQLAlchemy events (see http://docs.sqlalchemy.org/en/rel_0_9/core/event.html) are a relatively advanced feature that allows you to hook in to various operations that occur within the library. I think history events in this context refers to attribute events

[sqlalchemy] Re: Mechanism of reconciling for merge method

2014-07-17 Thread Bao Niu
For example, if I have User class which is mapped to user table. In user table there is a single row, whose id (primary key) equals 1, like this: id | name | gender | address 1 John male second best bathroom street, toilet#2 now I have this code: u = User(id=1)