Package gen :: Package lib :: Module attrbase :: Class AttributeBase
[frames] | no frames]

Class AttributeBase

source code


Base class for attribute-aware objects.

Instance Methods
 
__init__(self, source=None)
Initialize a AttributeBase.
source code
 
serialize(self)
Convert the object to a serialized tuple of data.
source code
 
unserialize(self, data)
Convert a serialized tuple of data to an object.
source code
 
add_attribute(self, attribute)
Add the Attribute instance to the object's list of attributes.
source code
bool
remove_attribute(self, attribute)
Remove the specified Attribute instance from the attribute list.
source code
list
get_attribute_list(self)
Return the list of Attribute instances associated with the object.
source code
 
set_attribute_list(self, attribute_list)
Assign the passed list to the Person's list of Attribute instances.
source code
Method Details

__init__(self, source=None)
(Constructor)

source code 

Initialize a AttributeBase.

If the source is not None, then object is initialized from values of the source object.

Parameters:
  • source (AttributeBase) - Object used to initialize the new object

add_attribute(self, attribute)

source code 

Add the Attribute instance to the object's list of attributes.

Parameters:

remove_attribute(self, attribute)

source code 

Remove the specified Attribute instance from the attribute list.

If the instance does not exist in the list, the operation has no effect.

Parameters:
Returns: bool
True if the attribute was removed, False if it was not in the list.

get_attribute_list(self)

source code 

Return the list of Attribute instances associated with the object.

Returns: list
Returns the list of Attribute instances.

set_attribute_list(self, attribute_list)

source code 

Assign the passed list to the Person's list of Attribute instances.

Parameters:
  • attribute_list (list) - List of Attribute instances to ba associated with the Person