summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-09-03 23:05:43 -0400
committerChris McDonough <chrism@plope.com>2011-09-03 23:05:43 -0400
commit54190dd68e0307cae3d21e5f8920e9a5ea379771 (patch)
tree07f8f0339eef3678d0432a60cd0b44c8a2e43916 /docs
parent3e4f6932ebee2f4680c1a16e46e4b5cc792241a2 (diff)
parentc2aae1f09786f1044ded7c61a83961fed87cc7d9 (diff)
downloadpyramid-54190dd68e0307cae3d21e5f8920e9a5ea379771.tar.gz
pyramid-54190dd68e0307cae3d21e5f8920e9a5ea379771.tar.bz2
pyramid-54190dd68e0307cae3d21e5f8920e9a5ea379771.zip
merge master into branch
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/environment.rst15
1 files changed, 13 insertions, 2 deletions
diff --git a/docs/narr/environment.rst b/docs/narr/environment.rst
index a5909e541..da93332c0 100644
--- a/docs/narr/environment.rst
+++ b/docs/narr/environment.rst
@@ -654,7 +654,18 @@ Here's how:
dictionary with the converted version of the variable *before* passing
it to the Configurator: the configurator makes a *copy* of ``settings``,
it doesn't use the one you pass directly.
-
+
+- When creating an ``includeme`` function that will be later added to your
+ application's configuration you may access the ``settings`` dictionary
+ through the instance of the :term:`Configurator` that is passed into the
+ function as its only argument. For Example:
+
+ .. code-block:: python
+
+ def includeme(config):
+ settings = config.registry.settings
+ debug_frobnosticator = settings['debug_frobnosticator']
+
- In the runtime code that you need to access the new settings value, find
the value in the ``registry.settings`` dictionary and use it. In
:term:`view` code (or any other code that has access to the request), the
@@ -662,7 +673,7 @@ Here's how:
.. code-block:: python
- registry = request.registry.settings
+ settings = request.registry.settings
debug_frobnosticator = settings['debug_frobnosticator']
If you wish to use the value in code that does not have access to the