[Twisted-web] nested nevow:data?

Jeff Bowden jlb at houseofdistraction.com
Mon Aug 9 22:34:49 MDT 2004


So is the behaviour I described below a bug or am I doing something wrong?

Jeff Bowden wrote:

> I made a little app to try to try to get nested data declarations 
> working (attached).  The app works if I remove nevow:data="outer" from 
> the template (render_outer doesn't depend on any data) but otherwise 
> it complains:
>
>    nevow.accessors.NoAccessor: None does not implement IContainer, and
>    there is no registered adapter.
>
> My expectation was that since data_outer just returns self this should 
> just mean that there are two copies of the TestPage instance on the 
> context stack.  Apparently my understanding is wrong.  Are there any 
> working examples of nested data declarations out there?
>
>
>------------------------------------------------------------------------
>
>from twisted.application import service, internet
>from nevow import rend, loaders, appserver
>
>
>class TestPage(rend.Page):
>    docFactory = loaders.htmlfile("testpage.html")
>    def __init__(self):
>        rend.Page.__init__(self)
>
>
>    def data_outer(self, context, data):
>        return self
>
>    def data_inner(self, context, data):
>        return [{'prop.1': 'data1', 'prop.2': 'data2'}]
>
>    def render_outer(self, context, data):
>        context.fillSlots("outer.title", "I'm soooo outer")
>        return context.tag
>
>site = appserver.NevowSite(TestPage())
> 
>application = service.Application("example")
>internet.TCPServer(8086, site).setServiceParent(application)
>
>  
>
>
> ------------------------------------------------------------------------
>
>
>   Title: TITLE
>
>     * prop.1 - prop.2
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Twisted-web mailing list
>Twisted-web at twistedmatrix.com
>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
>  
>




More information about the Twisted-web mailing list