twisted :: web :: resource :: IResource :: Class IResource
[hide private]
[frames] | no frames]

Class IResource



zope.interface.Interface --+
                           |
                          IResource

A web resource.

Instance Methods [hide private]
 
getChildWithDefault(name, request)
Return a child with the given name for the given request.
 
putChild(path, child)
Put a child IResource implementor at the given path.
 
render(request)
Render a request.
Class Variables [hide private]
  isLeaf = Attribute("""Signal if this IResource implementor is ...
  _InterfaceClass__attrs = {'getChildWithDefault': <zope.interfa...
  __bases__ = (<InterfaceClass zope.interface.Interface>)
  __identifier__ = 'twisted.web.resource.IResource'
  __iro__ = (<InterfaceClass twisted.web.resource.IResource>, <I...
  __name__ = 'IResource'
  __sro__ = (<InterfaceClass twisted.web.resource.IResource>, <I...
  _implied = {<InterfaceClass twisted.web.resource.IResource>: (...
  dependents = <WeakKeyDictionary at 182985296208>

Inherited from zope.interface.Interface (private): _Element__tagged_values

Method Details [hide private]

getChildWithDefault(name, request)

 
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.

render(request)

 
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.

Class Variable Details [hide private]

isLeaf

Value:
Attribute("""Signal if this IResource implementor is a "leaf node" or \
not. If True,
getChildWithDefault will not be called on this Resource.""")

_InterfaceClass__attrs

Value:
{'getChildWithDefault': <zope.interface.interface.Method object at 0x2\
a9ac5cc50>,
 'isLeaf': <zope.interface.interface.Attribute object at 0x2a9ac5c990>\
,
 'putChild': <zope.interface.interface.Method object at 0x2a9ac5cc90>,
 'render': <zope.interface.interface.Method object at 0x2a9ac5cc10>}

__iro__

Value:
(<InterfaceClass twisted.web.resource.IResource>,
 <InterfaceClass zope.interface.Interface>)

__sro__

Value:
(<InterfaceClass twisted.web.resource.IResource>,
 <InterfaceClass zope.interface.Interface>)

_implied

Value:
{<InterfaceClass twisted.web.resource.IResource>: (),
 <InterfaceClass zope.interface.Interface>: ()}