when should i commit with sqlalchemy using a for loop?,db.session.commit()