Class RowObject
- Known Subclasses:
-
IdentityRow
,
PerspectiveRow
,
TestRow
,
ChildRow
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 |
|
__setattr__ (self,
name,
value)
Special setattr to prevent changing of key values. |
|
assignKeyAttr (self,
attrName,
value)
Assign to a key attribute. |
|
createDefaultAttributes (self)
Populate instance with default attributes. |
|
findAttribute (self,
attrName)
Find an attribute by caseless name. |
|
getKeyTuple(self)
|
|
setDirty (self,
flag)
Use this to set the 'dirty' flag. |
__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 )
-
|
populated
-
- Type:
-
int
- Value:
|