t.e.r.RowObject : class documentation

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

I represent a row in a table in a relational database.

My class is "populated" by a Reflector object. After I am populated, instances of me are able to interact with a particular database table.

You should use a class derived from this class for each database table.

reflector.loadObjectsFrom() is used to create sets of instance of objects of this class from database tables.

Once created, the "key column" attributes cannot be changed.

Class Attributes that users must supply:
  rowKeyColumns     # list of key columns in form: [(columnName, typeName)]
  rowTableName      # name of database table
  rowColumns        # list of the columns in the table with the correct
                    # case.this will be used to create member variables.
  rowFactoryMethod  # method to create an instance of this class.
                    # HACK: must be in a list!!! [factoryMethod] (optional)
  rowForeignKeys    # keys to other tables (optional)
Method __init__ DEPRECATED.
Method assignKeyAttr Assign to a key attribute.
Method findAttribute Find an attribute by caseless name.
Method __setattr__ Special setattr to prevent changing of key values.
Method createDefaultAttributes Populate instance with default attributes.
Method setDirty Use this to set the 'dirty' flag.
Method getKeyTuple Undocumented
def __init__(self): (source)
DEPRECATED.
def assignKeyAttr(self, attrName, value): (source)

Assign to a key attribute.

This cannot be done through normal means to protect changing keys of db objects.
def findAttribute(self, attrName): (source)
Find an attribute by caseless name.
def __setattr__(self, name, value): (source)
Special setattr to prevent changing of key values.
def createDefaultAttributes(self): (source)

Populate instance with default attributes.

This is used when creating a new instance NOT from the database.
def setDirty(self, flag): (source)

Use this to set the 'dirty' flag.

(note: this avoids infinite recursion in __setattr__, and prevents the 'dirty' flag )
def getKeyTuple(self): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:27:37.