I represent a row in a table in a relational database.
My class is "populated" by a DBReflector 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.
enterprise.Augentation.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.
Methods
|
|
__setattr__
assignKeyAttr
createDefaultAttributes
findAttribute
setDirty
|
|
__setattr__
|
__setattr__ (
self,
name,
value,
)
Special setattr to prevent changing of key values.
Exceptions
|
|
DBError("cannot assign value <%s> to key column attribute <%s> of RowObject class" %( value, name ) )
|
|
|
assignKeyAttr
|
assignKeyAttr (
self,
attrName,
value,
)
Assign to a key attribute.
This cannot be done through normal means to protect changing
keys of db objects.
Exceptions
|
|
DBError( "%s is not a key columns." % attrName )
|
|
|
createDefaultAttributes
|
createDefaultAttributes ( self )
Populate instance with default attributes.
This is used when creating a new instance NOT from the
database.
|
|
findAttribute
|
findAttribute ( self, attrName )
Find an attribute by caseless name.
Exceptions
|
|
DBError( "Unable to find attribute %s" % attrName )
|
|
|
setDirty
|
setDirty ( self, flag )
Use this to set the dirty flag.
(note: this avoids infinite recursion in __setattr__, and
prevents the dirty flag )
|
|