Merge pull request #3059 from chrismorales/pyramid_tm_3052
set pyramid_tm.explicit_manager in the configuration
| | |
| | | |
| | | """ |
| | | settings = config.get_settings() |
| | | |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | # use pyramid_tm to hook the transaction lifecycle to the request |
| | | config.include('pyramid_tm') |
| | | |
| | |
| | | .. literalinclude:: src/models/tutorial/models/__init__.py |
| | | :linenos: |
| | | :language: py |
| | | :emphasize-lines: 8,9 |
| | | :emphasize-lines: 10,11 |
| | | |
| | | Here we align our imports with the names of the models, ``Page`` and ``User``. |
| | | |
| | |
| | | |
| | | """ |
| | | settings = config.get_settings() |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | |
| | | # use pyramid_tm to hook the transaction lifecycle to the request |
| | | config.include('pyramid_tm') |
| | |
| | | |
| | | """ |
| | | settings = config.get_settings() |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | |
| | | # use pyramid_tm to hook the transaction lifecycle to the request |
| | | config.include('pyramid_tm') |
| | |
| | | |
| | | """ |
| | | settings = config.get_settings() |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | |
| | | # use pyramid_tm to hook the transaction lifecycle to the request |
| | | config.include('pyramid_tm') |
| | |
| | | |
| | | """ |
| | | settings = config.get_settings() |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | |
| | | # use pyramid_tm to hook the transaction lifecycle to the request |
| | | config.include('pyramid_tm') |
| | |
| | | """ This function returns a Pyramid WSGI application. |
| | | """ |
| | | config = Configurator(settings=settings) |
| | | settings = config.get_settings() |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | config.include('pyramid_jinja2') |
| | | config.include('.models') |
| | | config.include('.routes') |
| | |
| | | |
| | | """ |
| | | settings = config.get_settings() |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | |
| | | # use pyramid_tm to hook the transaction lifecycle to the request |
| | | config.include('pyramid_tm') |
| | |
| | | |
| | | """ |
| | | settings = config.get_settings() |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | |
| | | # use pyramid_tm to hook the transaction lifecycle to the request |
| | | config.include('pyramid_tm') |
| | |
| | | |
| | | """ |
| | | settings = config.get_settings() |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | |
| | | # use pyramid_tm to hook the transaction lifecycle to the request |
| | | config.include('pyramid_tm') |
| | |
| | | |
| | | """ |
| | | settings = config.get_settings() |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | |
| | | # use pyramid_tm to hook the transaction lifecycle to the request |
| | | config.include('pyramid_tm') |
| | |
| | | """ This function returns a Pyramid WSGI application. |
| | | """ |
| | | config = Configurator(root_factory=root_factory, settings=settings) |
| | | settings = config.get_settings() |
| | | settings['tm.manager_hook'] = 'pyramid_tm.explicit_manager' |
| | | config.include('pyramid_chameleon') |
| | | config.add_static_view('static', 'static', cache_max_age=3600) |
| | | config.scan() |