From 6c2e8fb0f75939ebff014a7bf16500003ab9f1af Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 11 Jan 2012 02:30:57 -0600 Subject: Updated the changelogs. --- CHANGES.txt | 13 ++++++++++++- docs/whatsnew-1.3.rst | 15 ++++++++++----- pyramid/config/factories.py | 4 ++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 8950e75a2..a755f6418 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,14 @@ +Unreleased +========== + +Features +-------- + +- New API: ``pyramid.config.Configurator.set_request_property``. Add lazy + property descriptors to a request without changing the request factory. + This method provides conflict detection and is the suggested way to add + properties to a request. + 1.3a5 (2012-01-09) ================== @@ -25,7 +36,7 @@ Features - New API: ``pyramid.request.Request.set_property``. Add lazy property descriptors to a request without changing the request factory. New properties may be reified, effectively caching the value for the lifetime - of the instance. Common use-cases for this would be to get a database + of the instance. Common use-cases for this would be to get a database connection for the request or identify the current user. - Use the ``waitress`` WSGI server instead of ``wsgiref`` in scaffolding. diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index eb8617ff1..ee4e2ccb5 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -198,11 +198,16 @@ Extending a Request without Subclassing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It is now possible to extend a :class:`pyramid.request.Request` object -with property descriptors without having to create a subclass via -:meth:`pyramid.request.Request.set_property`. New properties may be -reified, effectively caching the value for the lifetime of the instance. -Common use-cases for this would be to get a database connection for the -request or identify the current user. +with property descriptors without having to create a custom request factory. +The new method :meth:`pyramid.config.Configurator.set_request_property` +provides an entry point for addons to register properties which will be +added to each request. New properties may be reified, effectively caching +the return value for the lifetime of the instance. Common use-cases for this +would be to get a database connection for the request or identify the current +user. The new method :meth:`pyramid.request.Request.set_property` has been +added, as well, but the configurator method should be preferred as it +provides conflict detection and consistency in the lifetime of the +properties. Minor Feature Additions ----------------------- diff --git a/pyramid/config/factories.py b/pyramid/config/factories.py index ca8d3f199..eb4442e98 100644 --- a/pyramid/config/factories.py +++ b/pyramid/config/factories.py @@ -72,6 +72,10 @@ class FactoriesConfiguratorMixin(object): :class:`pyramid.request.Request` class (particularly ``__call__``, and ``blank``). + See :meth:`pyramid.config.Configurator.set_request_property` + for a less intrusive way to extend the request objects with + custom properties. + .. note:: Using the ``request_factory`` argument to the -- cgit v1.2.3