- Depend on
wired >= 0.2
to use the newwired.ServiceContainer.register_singleton
api.
- Add a
NewServiceContainer
event that is emitted when the service container is created before any calls torequest.find_service
.
- Drop support for Python 2.7.
- Replace service lookup with https://wired.readthedocs.io under the hood.
- Fixes service lookup with custom contexts such that the context is passed through to nested service lookups.
- If the
iface
is a class then it must be the exact class that was registered originally. Subclasses are not identified as implementing the same interface at this time due to internal limitations.
- Allow the
iface
argument to be an arbitrary Python object / class. See mmerickel#10
- Drop Python 2.6 and Python 3.3 support.
Drop Python 3.2 support.
Use the original service context interface as the cache key instead of the current context. This means the service will be properly created only once for any context satisfying the original interface.
Previously, if you requested the same service from 2 different contexts in the same request you would receive 2 service objects, instead of a cached version of the original service, assuming the service was registered to satisfy both contexts. See mmerickel#12
- When using
request.find_service
during or before traversal therequest.context
is not valid. In these situations thecontext
parameter will default toNone
instead of raising an exception. See mmerickel#8 - Add
config.find_service_factory
andrequest.find_service_factory
. See mmerickel#4
- Change
find_service(..., context=None)
to use a context ofNone
. Previously this would fallback to usingrequest.context
if thecontext
wasNone
. Nowfind_service
will only fallback torequest.context
when nocontext
argument is specified. See mmerickel#3 - Support
introspectable
for services so that they show up in the pyramid_debugtoolbar and elsewhere. See mmerickel#2
- Support for
request.find_service
,config.register_service
, andconfig.register_service_factory
. - Initial commits.