teamniteo / pyramid_deferred_sqla

Opinionated SQLAlchemy + Pyramid integration with deferred configuration in mind.
MIT License
7 stars 5 forks source link

Support pshell scripts #1

Closed zupo closed 6 years ago

zupo commented 6 years ago

When using pshell scripts that bootstrap the pyramid environment with a fake request, the request does not go through the view mechanism and as such does not get the read_only attribute assigned.

This commit add support for doing the following in a pshell script:

from pyramid.paster import bootstrap
env = bootstrap(parser.parse_args().config)
env["request"].db