[Twisted-Python] Resource Tree

Jason Mobarak jason.mobarak at gmail.com
Tue Aug 31 20:52:38 MDT 2004


Afaik locateChild and getDynamicChild are intended for this.

Also:

class SomePage (Page):
  child_foo (self, context):
    return someFooResource
  child_bar (self, context):
    return someBarResource

On Wed, 01 Sep 2004 09:19:08 +0800, Tsai Li Ming <mailinglist at ltsai.com> wrote:
> Hi
> 
> For example, as given in the howto to handle url path segment:
> root = Hello()
> root.putChild('fred', Hello())
> root.putChild('bob', Hello())
> 
> Therefore, the following URLs are valid:
> http://example.com/
> http://example.com/fred
> http://example.com/bob
> http://example.com/fred/
> http://example.com/bob/
> 
> How do I handle non-existent url like http://example.com/foo?
> 
> Liming
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> 


-- 
Jason




More information about the Twisted-Python mailing list