diff options
| author | Michael Merickel <michael@merickel.org> | 2011-08-12 03:08:54 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2011-08-12 03:08:54 -0500 |
| commit | 9ec766cf34014de1e357a449133830ff944efb19 (patch) | |
| tree | 26e9632bae63aa7ecd27264bb2ca98c938e4bc91 /docs | |
| parent | c45737397842359010b3d517a1d5f9f34c6d1e53 (diff) | |
| download | pyramid-9ec766cf34014de1e357a449133830ff944efb19.tar.gz pyramid-9ec766cf34014de1e357a449133830ff944efb19.tar.bz2 pyramid-9ec766cf34014de1e357a449133830ff944efb19.zip | |
Updated the docs with the new over/under tuples.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/hooks.rst | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst index f81385c93..fafb407d3 100644 --- a/docs/narr/hooks.rst +++ b/docs/narr/hooks.rst @@ -948,6 +948,10 @@ Allowable values for ``under`` or ``over`` (or both) are: - One of the constants :attr:`pyramid.tweens.MAIN`, :attr:`pyramid.tweens.INGRESS`, or :attr:`pyramid.tweens.EXCVIEW`. +- An iterable of any combination of the above. This allows the user to specify + fallbacks if the desired tween is not included, as well as compatibility + with multiple other tweens. + Effectively, ``under`` means "closer to the main Pyramid application than", ``over`` means "closer to the request ingress than". @@ -999,10 +1003,14 @@ this:: Specifying neither ``over`` nor ``under`` is equivalent to specifying ``under=INGRESS``. -If an ``under`` or ``over`` value is provided that does not match a tween -factory dotted name or alias in the current configuration, that value will be -ignored. It is not an error to provide an ``under`` or ``over`` value that -matches an unused tween factory. +If all options for ``under`` (or ``over``) cannot be found in the current +configuration, it is an error. If some options are specified purely for +compatibilty with other tweens, just add a fallback of MAIN or INGRESS. +For example, ``under=('someothertween', 'someothertween2', INGRESS)``. +This constraint will require the tween to be located under both the +'someothertween' tween, the 'someothertween2' tween, and INGRESS. If any of +these is not in the current configuration, this constraint will only organize +itself based on the tweens that are present. :meth:`~pyramid.config.Configurator.add_tween` also accepts an ``alias`` argument. If ``alias`` is not ``None``, should be a string. The string will |
