[sqlalchemy] Re: KeyError when looping thru class objects to try and copy them

2017-12-20 Thread Tom Tanner
I moved `db.session.commit()` outside the loop. That seemed to fix the error. I'll post an update if I get more errors. On Wednesday, December 20, 2017 at 6:43:05 PM UTC-5, Lele Gaifax wrote: > > Tom Tanner writes: > > > I want to query rows and copy them while

[sqlalchemy] Re: KeyError when looping thru class objects to try and copy them

2017-12-20 Thread Lele Gaifax
Tom Tanner writes: > I want to query rows and copy them while changing an attribute of each. > Here's my code. > > colObjs= db.session.query(Column).filter_by(chart_id=oldChartID).all() > for colObj in colObjs: >make_transient(colObj) >print colObj.id >