t.w.r.IResource(Interface) : interface documentation

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

Known implementations: twisted.web._auth.wrapper.HTTPAuthSessionWrapper, twisted.web._auth.wrapper.UnauthorizedResource, twisted.web.resource.Resource, twisted.web.wsgi.WSGIResource

A web resource.
Attribute isLeaf Signal if this IResource implementor is a "leaf node" or not. If True, getChildWithDefault will not be called on this Resource.
Method getChildWithDefault No summary
Method putChild Put a child IResource implementor at the given path.
Method render No summary
isLeaf =
Signal if this IResource implementor is a "leaf node" or not. If True, getChildWithDefault will not be called on this Resource.
def getChildWithDefault(name, request): (source)
Return a child with the given name for the given request. This is the external interface used by the Resource publishing machinery. If implementing IResource without subclassing Resource, it must be provided. However, if subclassing Resource, getChild overridden instead.
def putChild(path, child): (source)
Put a child IResource implementor at the given path.
def render(request): (source)

Render a request. This is called on the leaf resource for a request. Render must return either a string, which will be sent to the browser as the HTML for the request, or server.NOT_DONE_YET. If NOT_DONE_YET is returned, at some point later (in a Deferred callback, usually) call request.write("<html>") to write data to the request, and request.finish() to send the data to the browser.

twisted.web.error.UnsupportedMethod can be raised if the HTTP verb requested is not supported by this resource.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:27:37.