Part of nevow.url View Source View In Hierarchy
Implements interfaces: nevow.inevow.IResource
Adapter for URL and URLOverlay instances that results in an HTTP
redirect.
Whenever a URL or URLOverlay instance is returned from locateChild or
renderHTTP an HTTP response is generated that causes a redirect to
the adapted URL. Any remaining segments of the current request are
consumed.
Note that URLOverlay instances are lazy so their use might not be entirely
obvious when returned from locateChild, i.e. url.here means the request's
URL and not the URL of the resource that is self.
def renderHTTP(self, ctx):
# Redirect to my immediate parent
return url.here.up()
def locateChild(self, ctx, segments):
# Redirect to the URL of this resource
return url.URL.fromContext(ctx)
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 552 | Method | __init__ | Undocumented |
| 555 | Method | locateChild | Locate another object which can be adapted to IResource |
| 558 | Method | renderHTTP | Render a request |