Part of twisted.web.woven.interfaces View Source View In Hierarchy
Known implementations: twisted.web.woven.controller.Controller
Method | setView | Set the view that this controller is related to. |
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 | __adapt__ | Undocumented |
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".
Return None if this Controller doesn't want to provide a Subcontroller for the given name.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.
This would generally be used like this:view.setSubcontrollerFactory("foo", MyFancyInputHandlerClass)This is equivalent to:
def wcfactory_foo(self, request, node, m): return MyFancyInputHandlerClass(m)Which will cause an instance of MyFancyInputHandlerClass to be instanciated when template node <div controller="foo" /> is encountered.