t.w.w.i.InputHandler(controller.Controller) : class documentation

Part of twisted.web.woven.input View Source View In Hierarchy

Known subclasses: twisted.web.woven.input.DefaultHandler, twisted.web.woven.input.List, twisted.web.woven.input.SingleValue

An InputHandler is like a controller, but it operates on something contained inside of self.model instead of directly on self.model. For example, a Handler whose model has been set to "foo" will handle self.model.foo.

The handler's job is to interpret the request and:
  1. Check for valid input
  2. If the input is valid, update the model
  3. Use any special API of the view widget to change the view (other than what the view updates automatically from the model) e.g. in the case of an error, tell the view to report an error to the user
  4. Return a success value; by default these values are simply recorded and the page is rendered, but these values could be used to determine what page to display next, etc.
Method __init__ Initialize.
Method initialize Undocumented
Method setNode Undocumented
Method getInput Return the data associated with this handler from the request, if any.
Method handle By default, we don't do anything
Method dispatchCheckResult Undocumented
Method check Check whether the input in the request is valid for this handler and return a boolean indicating validity.
Method handleValid It has been determined that the input for this handler is valid; however, that does not mean the entire form is valid.
Method aggregateValid No summary
Method handleInvalid Once it has been determined that the input is invalid, we should tell our view to report this fact to the user.
Method aggregateInvalid By default we just pass this method call all the way up to the root Controller.
Method commit It has been determined that the input for the entire form is completely valid; it is now safe for all handlers to commit changes to the model.

Inherited from Controller:

Method setupControllerStack Undocumented
Method importControllerLibrary No summary
Method getSubcontroller Look for a controller named "controllerName" to handle the node "node". When a node <div controller="foo" /> is present in the template, this method will be called with controllerName set to "foo".
Method setSubcontrollerFactory Set the callable "factory", which takes a model and should return an InputHandler, to be called by the default implementation of getSubview when the controllerName "name" is present in the template.
Method setView Set the view that this controller is related to.
Method setUp
Method getChild No summary
Method getDynamicChild No summary
Method wchild_index By default, we return ourself as the index. Override this to provide different behavior for a URL that ends in a slash.
Method render No summary
Method makeView Undocumented
Method renderView Undocumented
Method gatheredControllers Undocumented
Method process Undocumented
Method setSubmodel Undocumented
Method exit We are done handling the node to which this controller was attached.
Method domChanged Undocumented
Method pageRenderComplete Override this to recieve notification when the view rendering process is complete.

Inherited from Resource (via Controller):

Method listStaticNames Undocumented
Method listStaticEntities Undocumented
Method listNames Undocumented
Method listEntities Undocumented
Method listDynamicNames Undocumented
Method listDynamicEntities Undocumented
Method getStaticEntity Undocumented
Method getDynamicEntity Undocumented
Method delEntity Undocumented
Method reallyPutEntity Undocumented
Method getChildWithDefault Retrieve a static or dynamically generated child resource from me.
Method getChildForRequest Undocumented
Method putChild Register a static child.
Method render_HEAD Default handling of HEAD method.
def __init__(self, model=None, parent=None, name=None, check=None, commit=None, invalidErrorText=None, submodel=None, controllerStack=None): (source)
Initialize.
def initialize(self): (source)
Undocumented
def setNode(self, node): (source)
Undocumented
def getInput(self, request): (source)
Return the data associated with this handler from the request, if any.
def handle(self, request): (source)
By default, we don't do anything
def dispatchCheckResult(self, success, request, data): (source)
Undocumented
def check(self, request, data): (source)
Check whether the input in the request is valid for this handler and return a boolean indicating validity.
def handleValid(self, request, data): (source)
It has been determined that the input for this handler is valid; however, that does not mean the entire form is valid.
def aggregateValid(self, request, inputhandler, data): (source)
By default we just pass the method calls all the way up to the root Controller. However, an intelligent InputHandler could override this and implement a state machine that waits for all data to be collected and then fires.
def handleInvalid(self, request, data): (source)
Once it has been determined that the input is invalid, we should tell our view to report this fact to the user.
def aggregateInvalid(self, request, inputhandler, data): (source)
By default we just pass this method call all the way up to the root Controller.
def commit(self, request, node, data): (source)
It has been determined that the input for the entire form is completely valid; it is now safe for all handlers to commit changes to the model.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:02:37.