[Repoze-dev] Repoze CVS: intro.txt
Tres Seaver
tseaver at agendaless.com
Wed Sep 12 15:19:11 UTC 2007
Update of /home/repoze/cvs/repoze.obob/doc
In directory laguna.palladion.com:/tmp/cvs-serv16102/doc
Modified Files:
intro.txt
Log Message:
- Turn private methods into defaults with override via Paste config.
Index: intro.txt
===================================================================
RCS file: /home/repoze/cvs/repoze.obob/doc/intro.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- intro.txt 10 Sep 2007 23:12:15 -0000 1.1
+++ intro.txt 12 Sep 2007 15:19:08 -0000 1.2
@@ -53,6 +53,19 @@
If needed, create / check out database connections, etc., based on
request, as well as initializing any per-request policy settings.
+ 'request_factory' -- optional; called at the beginning of processing.
+
+ Contract::
+
+ request_factory(wsgi_environ) -> request
+
+ The result will be passed as 'request' to the remaining configuration
+ points.
+
+ E.g., in the Zope2 stack, return a ZPublisher.HTTPRequest.HTTPRequest.
+
+ The default implementation just returns 'environ'.
+
'before_traverse' -- optional; if defined, called before traversing each
edge.
@@ -60,7 +73,7 @@
before_traverse(current, name, request) # raise to veto
- E.g. in Zope2 stack, note location of most-recently-seen
+ E.g. in the Zope2 stack, note location of most-recently-seen
'__allow_groups__' user folder.
The callable may mutate request.
@@ -83,9 +96,32 @@
before_traverse(published, request) # raise to veto
- E.g., in Zope2 stack, ask the security machinery to authorize
+ E.g., in the Zope2 stack, ask the security machinery to authorize
access to the published object.
+ 'invoke' -- optional; called to get the result from the published object.
+
+ Contract::
+
+ invoke(published, request) -> result
+
+ E.g., in the Zope2`stack, use 'mapply'.
+
+ The default implementaition just calls 'published', passing the request.
+
+ 'map_result' -- optional; called to map the result onto triple for WSGI.
+
+ Contract::
+
+ map_result(request, result) -> status, headers, body_iter
+
+ E.g., in the Zope2`stack, extract status, headers, and body_iter from
+ the response object.
+
+ The default implementaition just returns simple success values:
+ status is 200, headers is an empty dict, body_iter is a list
+ containing the result.
+
The absolute minium configuration would thus be::
[app:obob]
_______________________________________________
Repoze-dev mailing list
Repoze-dev at lists.repoze.org
http://lists.repoze.org/mailman/listinfo/repoze-dev
More information about the Repoze-dev
mailing list