[sqlalchemy] Re: Session is commiting without an add()

2015-06-10 Thread Gilcan Machado
I've discovered if I use an object (found by session.query) as the value for the relationship field, I get the issue of having objects being added without explicit add() method. But if I insert, for the relationship, the id of the register in database (of the object got by session.query), I

[sqlalchemy] Re: Session is commiting without an add()

2015-06-10 Thread Jonathan Vanasco
You're experiencing exactly what Michael pointed you to. Person has a relationship+backref to SourceDatabase though `Person.source_database`. When you create a `John` and assign the existing source_database, sqlalchemy is implicitly adding the Person so that the update you explicitly