Class t.w.r.LeafResource(RenderMixin):

Part of twisted.web2.resource View Source View In Hierarchy

Known subclasses: twisted.web2.twcgi.CGIScript, twisted.web2.resource.RedirectResource, twisted.web2.auth.wrapper.UnauthorizedResource, twisted.web2.dav.resource.DAVLeafResource, twisted.web2.twscgi.SCGIClientResource, twisted.web2.plugin.TestResource, twisted.web2.plugin.NoPlugin

Implements interfaces: twisted.web2.iweb.IResource

A Resource with no children.
Line # Kind Name Docs
225 Method locateChild Locate another object which can be adapted to IResource.

Inherited from RenderMixin:

Line # Kind Name Docs
19 Method allowedMethods
27 Method checkPreconditions Checks all preconditions imposed by this resource upon a request made
53 Method renderHTTP See iweb.IResource.renderHTTP.
89 Method http_OPTIONS Respond to a OPTIONS request.
99 Method http_TRACE Respond to a TRACE request.
107 Method http_HEAD Respond to a HEAD request.
115 Method http_GET Respond to a GET request.
130 Method render Subclasses should implement this method to do page rendering.
def locateChild(self, request, segments):
Locate another object which can be adapted to IResource.
Returns

A 2-tuple of (resource, remaining-path-segments), or a deferred which will fire the above.

Causes the object publishing machinery to continue on with specified resource and segments, calling the appropriate method on the specified resource.

If you return (self, server.StopTraversal), this instructs web2 to immediately stop the lookup stage, and switch to the rendering stage, leaving the remaining path alone for your render function to handle.