[Twisted-web] Nevow guard with other than 'root' resource

Janne Junnila twisted-web@twistedmatrix.com
Sun, 7 Mar 2004 20:28:51 +0200


This is the first time I post to this list and my question follows:

I've tried to use Nevow's guard with non-root resource (Else than NevowSite).
The problem that raises upon is following:
	exceptions.AttributeError: 'SessionWrapper' object has no attribute 'renderHTTP'

The code I use goes like this:
	<SNIP />
	def __init__(self):
		realm=MyRealm()
		self.fooportal=portal.Portal(realm)
		myChecker=DatabaseChecker()
		self.fooportal.registerChecker(checkers.AllowAnonymousAccess(), credentials.IAnonymous)
		self.fooportal.registerChecker(myChecker)

	def getDynamicChild(self, name, request):
		if(name=='foo'):
			return guard.SessionWrapper(self.fooportal)
	<SNIP />

So are there good ways to get it working like this, or do i have to use some trick to do it, or (worst of all) is it even possible?


Nevow rules, thank you. =)

Janne Junnila