[Twisted-web] rendering sub-Pages in nevow (probable bug)

Federico Di Gregorio fog at initd.org
Mon May 3 07:18:40 MDT 2004


Hi *,

I am using nevow 0.1 so if this has been fixed/is a know problem just
redirect me to the right resource.

Apparently it is possible to serve a Page instance from a render_XXX
method if it is implemented as a rend.stan docFactory but not if it
tries to load a template from disk (rend.htmlfile). i.e., the following
code (add some imports, etc.) works:

        class Foo(rend.Page):
            docFactory = rend.htmlfile('foo.html')
        
            def render_content(self, context, data):
                return context.tag.clear()[Bar()]
        
        class Bar(rend.Page):
            docFactory = rend.stan(T.p["Some content"])

but if Bar is implemented as follows, a "maximum recursion depth
exceeded" error is raised (the function that gets called a zillion times
is renderer._strflatten):

        class Bar(rend.Page):
            docFactory = rend.htmlfile('bar.html')

I am trying to fix this, but I still don't know very well what happens
under the hood during the rendering process, so hints are very
apreciated. :)

thanks,
federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                fog at debian.org
INIT.D Developer                                           fog at initd.org
  We are all dust, Saqi, so play the lute
                    We are all wind, Saqi, so bring wine. -- Omar Khayam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata
Url : http://pyramid.twistedmatrix.com/pipermail/twisted-web/attachments/20040503/20d6f0b8/attachment.bin


More information about the Twisted-web mailing list