Re: [sqlalchemy] Why is assignment of a transient parent object does not automatically add this parent object into the session?

2015-02-10 Thread Bao Niu
I guess what I must do immediately is to get myself a pair of new glasses...Thank you Simon! On Tue, Feb 10, 2015 at 2:36 PM, Simon King si...@simonking.org.uk wrote: On 10 Feb 2015, at 22:14, Bao Niu niuba...@gmail.com wrote: Why is assignment of a transient parent object does not

[sqlalchemy] Why is assignment of a transient parent object does not automatically add this parent object into the session?

2015-02-10 Thread Bao Niu
Why is assignment of a transient parent object does not automatically add this parent object into the session? But Parent.append(PersistedChild) will do the job nicely? Here is my code: from sqlalchemy import Column, String, Integer, ForeignKey from sqlalchemy import create_engine from

Re: [sqlalchemy] Why is assignment of a transient parent object does not automatically add this parent object into the session?

2015-02-10 Thread Simon King
On 10 Feb 2015, at 22:14, Bao Niu niuba...@gmail.com wrote: Why is assignment of a transient parent object does not automatically add this parent object into the session? But Parent.append(PersistedChild) will do the job nicely? Here is my code: from sqlalchemy import Column, String,