Home | Trees | Index | Help |
|
---|
Package twisted :: Package enterprise :: Module row :: Class RowObject |
|
IdentityRow
,
PerspectiveRow
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 Summary | |
---|---|
Special setattr to prevent changing of key values. | |
Assign to a key attribute. | |
Populate instance with default attributes. | |
Find an attribute by caseless name. | |
getKeyTuple(self)
| |
Use this to set the 'dirty' flag. |
Class Variable Summary | |
---|---|
int |
dirty = 0 |
int |
populated = 0 |
Method Details |
---|
__setattr__(self, name, value)Special setattr to prevent changing of key values. |
assignKeyAttr(self, attrName, value)Assign to a key attribute. This cannot be done through normal means to protect changing keys of db objects. |
createDefaultAttributes(self)Populate instance with default attributes. This is used when creating a new instance NOT from the database. |
findAttribute(self, attrName)Find an attribute by caseless name. |
setDirty(self, flag)Use this to set the 'dirty' flag. (note: this avoids infinite recursion in __setattr__, and prevents the 'dirty' flag ) |
Class Variable Details |
---|
dirty
|
populated
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:08:25 2004 | http://epydoc.sf.net |