t.w.w.i.IModel(Interface) : interface documentation

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

Known implementations: twisted.web.woven.model.Model

A MVC Model.
Method addView Add a view for the model to keep track of.
Method removeView Remove a view that the model no longer should keep track of.
Method notify No summary
Method getData Return the raw data contained by this Model object, if it is a wrapper. If not, return self.
Method setData No summary
Method lookupSubmodel No summary
Method getSubmodel No summary
Method setSubmodel Set the given data as a submodel of this model. The data need not implement IModel, since getSubmodel should adapt the data to IModel before returning it.
def addView(view): (source)
Add a view for the model to keep track of.
def removeView(view): (source)
Remove a view that the model no longer should keep track of.
def notify(changed=None): (source)
Notify all views that something was changed on me. Passing a dictionary of {'attribute': 'new value'} in changed will pass this dictionary to the view for increased performance. If you don't want to do this, don't, and just use the traditional MVC paradigm of querying the model for things you're interested in.
def getData(): (source)
Return the raw data contained by this Model object, if it is a wrapper. If not, return self.
def setData(request, data): (source)
Set the raw data referenced by this Model object, if it is a wrapper. This is done by telling our Parent model to setSubmodel the new data. If this object is not a wrapper, keep the data around and return it for subsequent getData calls.
def lookupSubmodel(request, submodelPath): (source)
Return an IModel implementor for the given submodel path string. This path may be any number of elements separated by /. The default implementation splits on "/" and calls getSubmodel until the path is exhausted. You will not normally need to override this behavior.
def getSubmodel(request, submodelName): (source)
Return an IModel implementor for the submodel named "submodelName". If this object contains simple data types, they can be adapted to IModel using model.adaptToIModel(m, parent, name) before returning.
def setSubmodel(request, submodelName, data): (source)
Set the given data as a submodel of this model. The data need not implement IModel, since getSubmodel should adapt the data to IModel before returning it.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 15:57:47.