summaryrefslogtreecommitdiff
path: root/routes/__init__.py
diff options
context:
space:
mode:
authorbbangert <none@none>2005-12-18 15:00:04 -0800
committerbbangert <none@none>2005-12-18 15:00:04 -0800
commit12f7a4be9a0543e6261be7d96e4e576c312fab33 (patch)
treed7d415a89e4b230759d5593c3332c9831cb17c9a /routes/__init__.py
parentea4df47db6dc074dee228a2f5ec7ad5a2ba26292 (diff)
downloadroutes-12f7a4be9a0543e6261be7d96e4e576c312fab33.tar.gz
[svn] Doc updates
--HG-- branch : trunk
Diffstat (limited to 'routes/__init__.py')
-rw-r--r--routes/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/routes/__init__.py b/routes/__init__.py
index b2eda10..b055925 100644
--- a/routes/__init__.py
+++ b/routes/__init__.py
@@ -54,6 +54,9 @@ def request_config(original=False):
Set to the WSGI environ for automatic prefix support if the
webapp is underneath a 'SCRIPT_NAME'
+ Using your own requst local
+ +++++++++++++++++++++++++++
+
If you have your own request local object that you'd like to use instead of the default
thread local provided by Routes, you can configure Routes to use it::
@@ -66,6 +69,13 @@ def request_config(original=False):
Once you have configured request_config, its advisable you retrieve it again to get the
object you wanted. The variable you assign to request_local is assumed to be a callable
that will get the local config object you wish.
+
+ This example tests for the presence of the 'using_request_local' attribute which will be
+ present if you haven't assigned it yet. This way you can avoid repeat assignments of the
+ request specific callable.
+
+ Should you want the original object, perhaps to change the callable its using or stop
+ this behavior, call request_config(original=True).
"""
obj = _RequestConfig()
if hasattr(obj, 'request_local') and original is False: