[Commits] python.it commit r201 - twisted/trunk/contrib/nevow/doc/txt

commit a svn.python.it commit a svn.python.it
Sab 29 Lug 2006 12:11:59 CEST


Author: manlio
Date: Sat Jul 29 12:11:32 2006
New Revision: 201

Modified:
   twisted/trunk/contrib/nevow/doc/txt/nevow-sessions.txt
   twisted/trunk/contrib/nevow/doc/txt/nevow-traversal.txt
Log:
aggiunte

Modified: twisted/trunk/contrib/nevow/doc/txt/nevow-sessions.txt
==============================================================================
--- twisted/trunk/contrib/nevow/doc/txt/nevow-sessions.txt	(original)
+++ twisted/trunk/contrib/nevow/doc/txt/nevow-sessions.txt	Sat Jul 29 12:11:32 2006
@@ -220,3 +220,36 @@
 called when the session expires, just use the method::
 
   notifyOnExpire(callback)
+
+
+
+Problems with sessions
+++++++++++++++++++++++
+
+XXX TODO
+
+see http://twistedmatrix.com/pipermail/twisted-web/2006-July/002851.html
+
+Sessions and security
++++++++++++++++++++++
+
+In the old days, to authenticate users, people keep the password in
+clear in the Cookie.
+
+With Twisted and Nevow there are no more this problems.
+The Cookie simply contains a UID, used to lookup in a dictionary or a
+database, that reside **on** the server side.
+
+
+Permanent Sessions
+++++++++++++++++++
+
+Permanent sessions are no more that usual session with a long time to
+live.
+Each time the use login, the session is touched, to update its time to
+live.
+
+XXX TODO
+
+
+See also the Authencication chapter.

Modified: twisted/trunk/contrib/nevow/doc/txt/nevow-traversal.txt
==============================================================================
--- twisted/trunk/contrib/nevow/doc/txt/nevow-traversal.txt	(original)
+++ twisted/trunk/contrib/nevow/doc/txt/nevow-traversal.txt	Sat Jul 29 12:11:32 2006
@@ -14,6 +14,7 @@
 * `childFactory method`_
 * `child_* methods and attributes`_
 * `Dots in child names`_
+* `children dictionary`_
 * `The default trailing slash handler`_
 * `ICurrentSegments and IRemainingSegments`_
 
@@ -184,7 +185,7 @@
 
       def childFactory(self, ctx, name):
           if name not in self.dataDict:
-              return None # 404
+              return rend.NotFound # 404
           return DictTree(self.dataDict[name])
 
 As you can see, the ``childFactory`` implementation is considerably shorter than the
@@ -251,6 +252,35 @@
 The same technique could be used to install a child method with a dot in the
 name.
 
+children dictionary
+-------------------
+
+A last hook used by the default implementation of locateChils is
+``rend.Page.children`` dictionary::
+
+  class Main(rend.Page):
+      children = {
+      'people': People(),
+      'jobs': Jobs(),
+      'events': Events()
+      }
+      
+      def renderHTTP(self, ctx):
+          return """<html>
+          <head>
+          <title>Our Site</title>
+          <body>
+          <p>bla bla bla</p>
+          </body>
+          </html>"""
+
+
+Here is the order of the hooks:
+
+  1. ``self.dictionary``
+  2. ``self.child_*``
+  3. ``self.childFactory``
+
 The default trailing slash handler
 ----------------------------------
 


Maggiori informazioni sulla lista Commits