Seems tansaction.commit()
is the only way I have to make a commit in pyramid paster pshell
.
I understand it's good in serving webpages but in shell, after that, on next SQLAlchemy MyModel.my_attribute call I get:
DetachedInstanceError: Parent instance <MyModel at 0x9394d0c> is not bound to
a Session; lazy load operation of attribute 'my_attribute' cannot proceed
How can I avoid it?