https://travis-ci.org/NextThought/nti.app.pyramid_zope.svg?branch=master https://coveralls.io/repos/github/NextThought/nti.app.pyramid_zope/badge.svg?branch=master Documentation Status

This library provides a set of components (often in the zope.interface and zope.component meanings) to integrate Zope3 technologies into a modern Pyramid application.




Partial support for making a Pyramid request/response object pair work more like a Zope request.

Partially based on ideas from pyramid_zope_request

class PyramidZopeRequestProxy(base)[source]

Bases: zope.proxy.decorator.SpecificationDecoratorBase

Makes a Pyramid IRequest object look like a Zope request for purposes of rendering. The existing interfaces (IRequest) are preserved.

Changes to a proxy, including annotations, are persistent, and will be reflected if the same pyramid request is proxied again later (unlike pyramid_zope_request, which takes the approach of subclassing zope.publisher.base.BaseRequest and overriding certain methods to call through to pyramid, but not things like annotations.)


Most of this behaviour is added from reverse-engineering what existing zope code, most notably z3c.table.table uses. Some additional support for z3c.form comes from looking at what pyramid_zope_request does.

property environment

Alias for environ


Support for resource tree traversal.

class ZopeResourceTreeTraverser(root)[source]

Bases: pyramid.traversal.ResourceTreeTraverser

A pyramid.interfaces.ITraverser based on pyramid’s default traverser, but modified to use the zope.traversing.api machinery instead of (only) dictionary lookups. This provides is with the flexibility of the zope.traversing.interfaces.ITraversable adapter pattern, plus the support of namespace lookups (zope.traversing.namespace.nsParse() and zope.traversing.namespace.namespaceLookup()).

As this object traverses, it fires IBeforeTraverseEvent events. If you either load the configuration from zope.app.publication or manually enable the zope.site.site.threadSiteSubscriber to subscribe to this event, then any Zope site managers found along the way will be made the current site.


See pyramid.interfaces.ITraversar.__call__().


Initialize self. See help(type(self)) for accurate signature.

class resource(context, request)[source]

Bases: zope.traversing.namespace.resource

Handles resource lookup in a way compatible with zope.browserresource. This package registers resources as named adapters from IDefaultBrowserLayer to Interface. We connect the two by making the pyramid request implement the right thing.

__init__(context, request)[source]

Initialize self. See help(type(self)) for accurate signature.

Indices and tables