[Twisted-web] overriding resource getting with nevow+twisted

Donovan Preston dp at ulaluma.com
Wed Nov 24 17:20:08 MST 2004


On Nov 24, 2004, at 3:39 PM, Samuel Reynolds wrote:

>> Err, despite my earlier message, of course, getDynamicChild *was* 
>> also in Nevow until recently. But now it's deprecated, and also not 
>> the "main" method, which was and is locateChild. Sorry 'bout the 
>> confusion. ;)
>>
>> James
>
> Well, then. That'll require some changes on my part
> when I start to update my code to the newer nevow.
> FWIW, OMM nevow.__version__=='0.1d'.

getDynamicChild still works in 0.3 but you get a deprecation warning 
when it exists. It will stop working in 0.4. The replacement is named 
childFactory and the only difference is the order of the arguments, 
which was changed to be consistent with the rest of nevow:

def getDynamicChild(self, name, ctx):

def childFactory(self, ctx, name):

> I never said getDynamicChild  was the "main" method.
> Just that it was the intercept point for inserting
> dynamically-selected pages.

To recap:

locateChild is the only traversal API required by IResource. It is 
called directly by the object publisher (NevowSite).

The default locateChild implementation on nevow.rend.Page looks in two 
places:

child_*
childFactory (replaces getDynamicChild)

> I've tried to keep an eye on the discussion list, but
> I haven't kept up-to-date on the (seemingly endless!)
> changes to nevow & twisted due to other projects.
> I'll have to update my copy when I have time to make
> the necessary changes in my code.

The changes will start to slow down now. Most of the major refactorings 
which I wanted to take place have happened, so it should mostly be 
minor bugfixes and new feature additions going forward.

dp




More information about the Twisted-web mailing list