Package RelLib :: Module _AttributeBase :: 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
 
add_attribute(self, attribute)
Adds the Attribute instance to the object's list of attributes
source code
list
get_attribute_list(self)
Returns the list of Attribute instances associated with the object.
source code
bool
remove_attribute(self, attribute)
Removes the specified Attribute instance from the attribute list If the instance does not exist in the list, the operation has no effect.
source code
 
serialize(self)
Converts the object to a serialized tuple of data
source code
 
set_attribute_list(self, attribute_list)
Assigns the passed list to the Person's list of Attribute instances.
source code
 
unserialize(self, data)
Converts a serialized tuple of data to an object
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 
Adds the Attribute instance to the object's list of attributes
Parameters:

get_attribute_list(self)

source code 
Returns the list of Attribute instances associated with the object.
Returns: list
Returns the list of Attribute instances.

remove_attribute(self, attribute)

source code 
Removes 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.

set_attribute_list(self, attribute_list)

source code 
Assigns 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