Package twisted :: Package web :: Package woven :: Module model :: Class ListModel

[frames | no frames]

## Class ListModel

    Model --+
            |
      Wrapper --+
                |
               ListModel

Known Subclasses:
  `StringModel`

I wrap a Python list and allow it to interact with the Woven models and submodels.

Method Summary
| `__getitem__(self, name)`
| `__len__(self)`
| `__repr__(self)`
| `__setitem__(self, name, value)`
| `dataWillChange(self)`
| ``getSubmodel`(self, request, name)` Get the submodel `name' of this model.
| ``setSubmodel`(self, request, name, value)` Set a submodel on this model.
Inherited from Wrapper
| ``__init__`(self, orig)`
Inherited from Model
| ``__getstate__`(self)`
| ``addSubview`(self, name, subview)`
| ``addView`(self, view)` Add a view for the model to keep track of.
| ``getData`(self, request)`
| ``initialize`(self, *args, **kwargs)` Hook for subclasses to initialize themselves without having to mess with the __init__ chain.
| ``invalidateCache`(self)` Invalidate the cache for this object, so the next time getData is called, it's getter method is called again.
| ``lookupSubmodel`(self, request, submodelName)` Look up a full submodel name.
| ``notify`(self, changed)` Notify all views that something was changed on me.
| ``removeView`(self, view)` Remove a view that the model no longer should keep track of.
| ``setData`(self, request, data)`
| ``setGetter`(self, getter)`
| ``setSetter`(self, setter)`
| ``submodelCheck`(self, request, name)` Check if a submodel name is allowed.
| ``submodelFactory`(self, request, name)`

Class Variable Summary
Inherited from Wrapper
`NoneType` | `name` = None
`NoneType` | `parent` = None
Inherited from Model
`list` | `allowed_names` = `[]`
`list` | `protected_names` = `['initialize', 'addView', 'addSubview'...`

Method Details

### getSubmodel(self, request=None, name=None)

Get the submodel `name' of this model. If I ever return a Deferred, then I ought to check for cached values (created by `setSubmodel`) before doing a regular Deferred lookup.

  Overrides:
    `twisted.web.woven.model.Model.getSubmodel` (inherited documentation)

### setSubmodel(self, request=None, name=None, value=None)

Set a submodel on this model. If getSubmodel or lookupSubmodel ever return a Deferred, I ought to set this in a place that lookupSubmodel/getSubmodel know about, so they can use it as a cache.

  Overrides:
    `twisted.web.woven.model.Model.setSubmodel` (inherited documentation)

Generated by Epydoc 2.0 on Sat May 15 20:08:37 2004 | http://epydoc.sf.net