Package twisted :: Package web :: Package woven :: Module view :: Class View
[show private | hide private]
[frames | no frames]

Class View

Collection --+                
             |                
   Constrained --+            
                 |            
  ConfigCollection --+        
                     |        
              Resource --+    
                         |    
               DOMTemplate --+
                             |
                            View

Known Subclasses:
Widget, ThankYou, LiveView, Page, MyView, LLView, VNotifyTest, VDemo, VIdentityList

Method Summary
  __init__(self, m, templateFile, controller, doneCallback, modelStack, viewStack, controllerStack)
A view must be told what its model is, and may be told what its controller is, but can also look up its controller if none specified.
  __setitem__(self, key, value)
  delEntity(self, name)
Remove a static reference for 'name'. (inherited from Resource)
  dispatchResult(self, request, node, result)
Check a given result from handling a node and hand it to a process* method which will convert the result into a node and insert it into the DOM tree. (inherited from DOMTemplate)
  dispatchResultCallback(self, result, request, node)
Deal with a callback from a deferred, dispatching the result and recursing children. (inherited from DOMTemplate)
  entityConstraint(self, entity)
A method that determines whether an entity may be added to me. (inherited from ConfigCollection)
  generate(self, request, node)
Allow a view to be used like a widget.
  getChild(self, path, request)
Retrieve a 'child' resource from me. (inherited from Resource)
  getChildForRequest(self, request)
(internal) Get a child of mine dependant on a particular request. (inherited from Resource)
  getChildWithDefault(self, path, request)
(internal) Retrieve a static or dynamically generated child resource from me. (inherited from Resource)
  getDynamicEntity(self, name, request)
Subclass this to generate an entity on demand. (inherited from Resource)
  getEntity(self, name, request)
Retrieve an entity from me. (inherited from Collection)
  getEntityType(self)
(inherited from ConfigCollection)
  getNameType(self)
(inherited from ConfigCollection)
  getNodeController(self, request, node, submodel, model)
Get a controller object to handle this node.
  getNodeModel(self, request, node, submodel)
Get the model object associated with this node.
  getNodeView(self, request, node, submodel, model)
  getStaticEntity(self, name)
Get an entity that was added to me using putEntity. (inherited from Resource)
  getSubview(self, request, node, model, viewName)
Get a sub-view from me.
  getTemplate(self, request)
Override this if you want to have your subclass look up its template using a different method. (inherited from DOMTemplate)
  handleControllerResults(self, controllerResult, request, node, controller, view, success)
  handleDocument(self, request, document)
Handle the root node, and send the page if there are no outstanding callbacks when it returns. (inherited from DOMTemplate)
  handleModel(self, model, request, node, submodelName)
  handleModelLater(self, model, request, node, submodelName)
  handleNewNode(self, request, returnNode)
  handleNode(self, request, node)
Handle a single node by looking up a method for it, calling the method and dispatching the result.
  importViewLibrary(self, namespace)
  listDynamicEntities(self, request)
A list of all name, entity that I can generate on demand. (inherited from Resource)
  listDynamicNames(self)
Retrieve a list of the names of entities that I store references to. (inherited from Resource)
  listEntities(self)
Retrieve a list of all name, entity pairs that I store references to. (inherited from Resource)
  listNames(self)
Retrieve a list of the names of entities that I store references to. (inherited from Resource)
  listStaticEntities(self)
Retrieve a list of all name, entity pairs that I store references to. (inherited from Resource)
  listStaticNames(self)
Retrieve a list of the names of entities that I store references to. (inherited from Resource)
  lookupTemplate(self, request)
Use acquisition to look up the template named by self.templateFile, located anywhere above this object in the heirarchy, and use it as the template. (inherited from DOMTemplate)
  modelChanged(self, changed)
Dispatch changed messages to any update_* methods which may have been defined, then pass the update notification on to the controller.
  nameConstraint(self, name)
A method that determines whether an entity may be added to me with a given name. (inherited from Constrained)
  putChild(self, path, child)
Register a child with me. (inherited from Resource)
  putEntity(self, name, entity)
Store an entity if it meets both constraints. (inherited from Constrained)
  reallyPutEntity(self, name, entity)
(inherited from Resource)
  recurseChildren(self, request, node)
If this node has children, handle them. (inherited from DOMTemplate)
  removeEntity(self, name, request)
Remove an entity for 'name', based on the content of 'request'. (inherited from Collection)
  render(self, request)
Render a given resource.
  renderFailure(self, failure, request)
(inherited from DOMTemplate)
  sendPage(self, request)
Check to see if handlers recorded any errors before sending the page
  setController(self, controller)
  setNode(self, node)
  setSubmodel(self, name)
  setSubviewFactory(self, name, factory, setup, *args, **kwargs)
  setUp(self, request, document)
(inherited from DOMTemplate)
  setupViewStack(self)
  storeEntity(self, name, request)
Store an entity for 'name', based on the content of 'request'. (inherited from Collection)
  unlinkViews(self)

Class Variable Summary
tuple __implements__
int setupStacks
list viewLibraries
int wantsAllNotifications

Method Details

__init__(self, m, templateFile=None, controller=None, doneCallback=None, modelStack=None, viewStack=None, controllerStack=None)
(Constructor)

A view must be told what its model is, and may be told what its controller is, but can also look up its controller if none specified.
Overrides:
twisted.web.woven.template.DOMTemplate.__init__

generate(self, request, node)

Allow a view to be used like a widget. Will look up the template file and return it in place of the incoming node.

getNodeController(self, request, node, submodel, model)

Get a controller object to handle this node. If the node has no controller= attribute, first check to see if there is an IController adapter for our model.

getNodeModel(self, request, node, submodel)

Get the model object associated with this node. If this node has a model= attribute, call getSubmodel on the current model object. If not, return the top of the model stack.

getSubview(self, request, node, model, viewName)

Get a sub-view from me.
Returns:
widgets.Widget

handleNode(self, request, node)

Handle a single node by looking up a method for it, calling the method and dispatching the result.

Also, handle all childNodes of this node using recursion.
Overrides:
twisted.web.woven.template.DOMTemplate.handleNode (inherited documentation)

modelChanged(self, changed)

Dispatch changed messages to any update_* methods which may have been defined, then pass the update notification on to the controller.

render(self, request, doneCallback=None)

Render a given resource.

This must be implemented in all subclasses of Resource.

The return value of this method will be the rendered page, unless the return value is twisted.web.server.NOT_DONE_YET, in which case it is this class's responsibility to write the results to request.write(data), then call request.finish().
Overrides:
twisted.web.woven.template.DOMTemplate.render (inherited documentation)

sendPage(self, request)

Check to see if handlers recorded any errors before sending the page
Overrides:
twisted.web.woven.template.DOMTemplate.sendPage

Class Variable Details

__implements__

Type:
tuple
Value:
((<class twisted.web.resource.IResource at 0x1029c3d8>,
  <class twisted.coil.coil.IConfigCollection at 0x102c3460>),
 <class twisted.web.woven.interfaces.IView at 0x10761738>)             

setupStacks

Type:
int
Value:
1                                                                      

viewLibraries

Type:
list
Value:
[]                                                                     

wantsAllNotifications

Type:
int
Value:
0                                                                      

Generated by Epydoc 1.2 prerelease on Wed Jan 29 06:26:35 2003 http://epydoc.sf.net