[Twisted-web] CSS - locateChild

Valentino Volonghi aka Dialtone dialtone at divmod.com
Sat Nov 19 06:10:31 MST 2005

On Sat, Nov 19, 2005 at 12:28:57PM +0100, dsalvatore at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20051119/156e731a/attachment.pgp

More information about the Twisted-web mailing list