Hello, In the following example, without the 'locateChild' the css style sheet is rendered, but not when I try to uses locateChild. Betwise, is this a good way to refresh a page using 'return self,()' ? Thank you for your help Salvatore from twisted.application import service, internet from nevow import loaders,rend,appserver,static class Page(rend.Page): child_css = static.File('css') docFactory = loaders.xmlfile('xmlsite.xml') def render_left(self,context,data): return data def data_menu(self,context,data): return data def locateChild(self,context,data): return self,() site = appserver.NevowSite(Page("TEST")) application = service.Application('example') internet.TCPServer(8080, site).setServiceParent(application)
On Sat, Nov 19, 2005 at 12:28:57PM +0100, dsalvatore@freesurf.fr wrote:
Hello,
In the following example, without the 'locateChild' the css style sheet is rendered, but not when I try to uses locateChild.
Betwise, is this a good way to refresh a page using 'return self,()' ?
Thank you for your help
Salvatore
from twisted.application import service, internet from nevow import loaders,rend,appserver,static
class Page(rend.Page):
child_css = static.File('css') docFactory = loaders.xmlfile('xmlsite.xml')
def render_left(self,context,data): return data
def data_menu(self,context,data): return data
def locateChild(self,context,data): return self,()
Do you realize that this locateChild never relies on the default locateChild behaviour? Which means that it ALWAYS returns self and no more segments to process wherever you put this with whatever url you passed to it. This page will render only itself even for its children, you have to check what the 'data' (that should actually be segments) argument of locateChild is. -- Valentino Volonghi aka Dialtone Now Running MacOSX 10.4 Blog: http://vvolonghi.blogspot.com http://weever.berlios.de
participants (2)
-
dsalvatore@freesurf.fr
-
Valentino Volonghi aka Dialtone