Re: [sqlalchemy] How do I get an object and update multiple fields in sqlalchemy

2017-08-21 Thread Simon King
Are you flushing the same session that was used to load the record? What session does get_instance use? Simon On Mon, Aug 21, 2017 at 7:47 AM, pravin battula wrote: > I did as below. But didn't work. Am i missing anything else. > > def update_record(session, id): >

Re: [sqlalchemy] How do I get an object and update multiple fields in sqlalchemy

2017-08-21 Thread pravin battula
I did as below. But didn't work. Am i missing anything else. def update_record(session, id): record_instance = get_instance(id) if record_instance: updateobj(record_instance, {'time_zone':'GMT','status':'done'}) session.flush() session.commit() def updateobj(obj,