[Twisted-Python] HTTP Authentication Example for review

Christopher Armstrong radix at twistedmatrix.com
Wed Jul 16 13:52:49 MDT 2003


On Wed, Jul 16, 2003 at 03:00:26PM -0400, David McCurley wrote:
> The one thing so far that I don't like (ref MyGuard) is that it looks
> like I have to do checks in the following methods (at least):
> 
> render()
> getChild()
> getChildWithDefault()
> getChildForRequest()

No, you only need to override render and
getChildWithDefault. getChildForRequest will call getChildWithDefault,
and getChildWithDefault is responsible for calling getChild. So as
long as you have isLeaf=True, getChildWithDefault will catch any
getChild.

> class MyAuth(baseRes):
>     isLeaf = True

-- 
 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/




More information about the Twisted-Python mailing list