class documentation

class MutableComposite(MutableBase):

View In Hierarchy

Mixin that defines transparent propagation of change events on a SQLAlchemy "composite" object to its owning parent or parents.

See the example in :ref:`mutable_composites` for usage information.

Method changed Subclasses should call this method whenever change events occur.
Class Method ​_get​_listen​_keys Given a descriptor attribute, return a set() of the attribute keys which indicate a change in the state of this attribute.

Inherited from MutableBase:

Class Method coerce Given a value, coerce it into the target type.
Class Method ​_listen​_on​_attribute Establish this type as a mutation listener for the given mapped descriptor.
Property ​_parents Dictionary of parent object's .InstanceState->attribute name on the parent.
def changed(self):
Subclasses should call this method whenever change events occur.
@classmethod
def _get_listen_keys(cls, attribute):

Given a descriptor attribute, return a set() of the attribute keys which indicate a change in the state of this attribute.

This is normally just set([attribute.key]), but can be overridden to provide for additional keys. E.g. a .MutableComposite augments this set with the attribute keys associated with the columns that comprise the composite value.

This collection is consulted in the case of intercepting the .InstanceEvents.refresh and .InstanceEvents.refresh_flush events, which pass along a list of attribute names that have been refreshed; the list is compared against this set to determine if action needs to be taken.

New in version 1.0.5.