Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Set up am implicit 'tween' to do transaction management using the
``transaction`` package.  The tween will be slotted between the main
Pyramid app and the Pyramid exception view handler.

For every request it handles, the tween will begin a transaction by
calling ``transaction.begin()``, and will then call the downstream
handler (usually the main Pyramid application request handler) to obtain
a response.  When attempting to call the downstream handler:

- If an exception is raised by downstream handler while attempting to(more...)

        def includeme(config):
    """
    Set up am implicit 'tween' to do transaction management using the
    ``transaction`` package.  The tween will be slotted between the main
    Pyramid app and the Pyramid exception view handler.

    For every request it handles, the tween will begin a transaction by
    calling ``transaction.begin()``, and will then call the downstream
    handler (usually the main Pyramid application request handler) to obtain
    a response.  When attempting to call the downstream handler:

    - If an exception is raised by downstream handler while attempting to
      obtain a response, the transaction will be rolled back
      (``transaction.abort()`` will be called).

    - If no exception is raised by the downstream handler, but the
      transaction is doomed (``transaction.doom()`` has been called), the
      transaction will be rolled back.

    - If the deployment configuration specifies a ``tm.commit_veto`` setting,
      and the transaction management tween receives a response from the
      downstream handler, the commit veto hook will be called.  If it returns
      True, the transaction will be rolled back.  If it returns False, the
      transaction will be committed.

    - If none of the above conditions are True, the transaction will be
      committed (via ``transaction.commit()``).
    """
    config.add_tween('pyramid_tm.tm_tween_factory', under=EXCVIEW)
        


src/p/y/pyramid_tm-HEAD/pyramid_tm/tests.py   pyramid_tm(Download)
    def test_it(self):
        from pyramid.tweens import EXCVIEW
        from pyramid_tm import includeme
        config = DummyConfig()
        includeme(config)

src/p/y/pyramid_tm-0.7/pyramid_tm/tests.py   pyramid_tm(Download)
    def test_it(self):
        from pyramid.tweens import EXCVIEW
        from pyramid_tm import includeme
        config = DummyConfig()
        includeme(config)