t.e.r.Reflector : class documentation

Part of twisted.enterprise.reflector View Source View In Hierarchy

Known subclasses: twisted.enterprise.sqlreflector.SQLReflector

DEPRECATED.

Base class for enterprise reflectors. This implements row caching.
Method __init__ Initialize me against a database.
Method __getstate__ Undocumented
Method __setstate__ Undocumented
Method populateSchemaFor This is called once for each registered rowClass to add it and its foreign key relationships for that rowClass to the schema.
Method getTableInfo Get a TableInfo record about a particular instance.
Method buildWhereClause util method used by reflectors. builds a where clause to link a row to another table.
Method addToParent util method used by reflectors. adds these rows to the parent row object. If a rowClass does not have a containerMethod, then a list attribute "childRows" will be used.
Method addToCache NOTE: Should this be recursive?! requires better container knowledge...
Method findInCache Undocumented
Method removeFromCache NOTE: should this be recursive!??
Method loadObjectsFrom Implement me to load objects from the database.
Method updateRow update this rowObject to the database.
Method insertRow insert a new row for this object instance.
Method deleteRow delete the row for this object from the database.
Method _populate Implement me to populate schema information for the reflector.
def __init__(self, rowClasses): (source)
Initialize me against a database.
ParametersrowClassesa list of row class objects that describe the database schema.
def __getstate__(self): (source)
Undocumented
def __setstate__(self, state): (source)
Undocumented
def _populate(self): (source)
Implement me to populate schema information for the reflector.
def populateSchemaFor(self, tableInfo): (source)
This is called once for each registered rowClass to add it and its foreign key relationships for that rowClass to the schema.
def getTableInfo(self, rowObject): (source)

Get a TableInfo record about a particular instance.

This record contains various information about the instance's class as registered with this reflector.
ParametersrowObjecta RowObject instance of a class previously registered with me.
Raisestwisted.enterprise.row.DBErrorraised if this class was not previously registered.
def buildWhereClause(self, relationship, row): (source)
util method used by reflectors. builds a where clause to link a row to another table.
def addToParent(self, parentRow, rows, tableName): (source)
util method used by reflectors. adds these rows to the parent row object. If a rowClass does not have a containerMethod, then a list attribute "childRows" will be used.
def addToCache(self, rowObject): (source)
NOTE: Should this be recursive?! requires better container knowledge...
def findInCache(self, rowClass, kw): (source)
Undocumented
def removeFromCache(self, rowObject): (source)
NOTE: should this be recursive!??
def loadObjectsFrom(self, tableName, parent=None, data=None, whereClause=, loadChildren=1): (source)
Implement me to load objects from the database.
ParameterswhereClausea list of tuples of (columnName, conditional, value) so it can be parsed by all types of reflectors. eg.:
 whereClause = [("name", EQUALS, "fred"), ("age", GREATERTHAN, 18)]
def updateRow(self, rowObject): (source)
update this rowObject to the database.
def insertRow(self, rowObject): (source)
insert a new row for this object instance.
def deleteRow(self, rowObject): (source)
delete the row for this object from the database.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 15:57:47.