diff options
| author | kusut <tinokusut@gmail.com> | 2013-01-29 22:16:00 +0700 |
|---|---|---|
| committer | kusut <tinokusut@gmail.com> | 2013-01-29 22:16:00 +0700 |
| commit | 5b9c21ebe7d295bb9ac4356033899181ac69396e (patch) | |
| tree | e94a687f4ea7186ce70ad97ad24b93045d4a7073 /docs | |
| parent | 9db1a14cd16f6e92fdb72650d2a3e3ef6e55ef9a (diff) | |
| download | pyramid-5b9c21ebe7d295bb9ac4356033899181ac69396e.tar.gz pyramid-5b9c21ebe7d295bb9ac4356033899181ac69396e.tar.bz2 pyramid-5b9c21ebe7d295bb9ac4356033899181ac69396e.zip | |
enhance!
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/hooks.rst | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst index 957426ec2..d693149e4 100644 --- a/docs/narr/hooks.rst +++ b/docs/narr/hooks.rst @@ -264,18 +264,18 @@ already constructed a :term:`configurator` it can also be registered via the Adding Methods or Properties to Request Object ---------------------------------------------- -Since each pyramid application can only have one :term:`request` factory, +.. versionadded:: 1.4. + +Since each Pyramid application can only have one :term:`request` factory, :ref:`changing the request factory <changing_the_request_factory>` -is not that extensible especially if you want to build composable features -(e.g., pyramid add-ons and plugins). +is not that extensible, especially if you want to build composable features +(e.g., Pyramid add-ons and plugins). A lazy property can be registered to the request object via the :meth:`pyramid.config.Configurator.add_request_method` API. This allows you to specify a callable that will be available on the request object, but will not actually execute the function until accessed. -.. note:: This feature is new as of Pyramid 1.4. - .. warning:: This will silently override methods and properties from :term:`request factory` that have the same name. @@ -318,7 +318,6 @@ Here is an example of passing a class to ``Configurator.add_request_method``: from pyramid.config import Configurator from pyramid.decorator import reify - class ExtraStuff(object): def __init__(self, request): @@ -346,7 +345,6 @@ We attach and cache an object named ``extra`` to the ``request`` object. >>> request.extra.prop the property - .. index:: single: before render event single: adding renderer globals |
