class documentation

class CompositeProperty(DescriptorProperty):

View In Hierarchy

Defines a "composite" mapped attribute, representing a collection of columns as one attribute.

.CompositeProperty is constructed using the .composite function.

Class ​Comparator Produce boolean, comparison, and other operators for .CompositeProperty attributes.
Class ​Composite​Bundle Undocumented
Method __init__ Return a composite column-based property for use with a Mapper.
Method __str__ Undocumented
Method ​_comparator​_factory Undocumented
Method ​_create​_descriptor Create the Python descriptor that will serve as the access point on instances of the mapped class.
Method ​_setup​_arguments​_on​_columns Propagate configuration arguments made on this composite to the target columns, for those that apply.
Method ​_setup​_event​_handlers Establish events that populate/expire the composite attribute.
Method do​_init Initialization which occurs after the .CompositeProperty has been associated with its parent mapper.
Method get​_history Provided for userland code that uses attributes.get_history().
Method instrument​_class Hook called by the Mapper to the property to initiate instrumentation of the class attribute managed by this MapperProperty.
Constant ​_COMPOSITE​_FGET Undocumented
Instance Variable active​_history Undocumented
Instance Variable attrs Undocumented
Instance Variable comparator​_factory Undocumented
Instance Variable composite​_class Undocumented
Instance Variable deferred Undocumented
Instance Variable descriptor Undocumented
Instance Variable group Undocumented
Instance Variable info Undocumented
Property ​_attribute​_keys Undocumented
Property ​_comparable​_elements Undocumented
Property columns Undocumented
Property props Undocumented

Inherited from DescriptorProperty:

Class Variable ​_links​_to​_entity True if this MapperProperty refers to a mapped entity.
Class Variable doc Undocumented
Class Variable uses​_objects Undocumented

Inherited from MapperProperty (via DescriptorProperty):

Method __repr__ Undocumented
Method ​_memoized​_attr​_info Info dictionary associated with the object, allowing user-defined data to be associated with this .InspectionAttr.
Method cascade​_iterator Iterate through instances related to the given instance for a particular 'cascade', starting with this MapperProperty.
Method create​_row​_processor Produce row processing functions and append to the given set of populators lists.
Method init Called after all mappers are created to assemble relationships between mappers and perform other post-mapper-creation initialization steps.
Method merge Merge the attribute represented by this MapperProperty from source to destination object.
Method post​_instrument​_class Perform instrumentation adjustments that need to occur after init() has completed.
Method set​_parent Set the parent mapper that references this MapperProperty.
Method setup Called by Query for the purposes of constructing a SQL statement.
Class Variable __slots__ Undocumented
Class Variable ​_cache​_key​_traversal Undocumented
Class Variable cascade The set of 'cascade' attribute names.
Class Variable is​_property Part of the InspectionAttr interface; states this object is a mapper property.
Instance Variable ​_configure​_finished Undocumented
Instance Variable ​_configure​_started Undocumented
Instance Variable parent Undocumented
Property class​_attribute Return the class-bound descriptor corresponding to this .MapperProperty.

Inherited from HasCacheKey (via DescriptorProperty, MapperProperty):

Class Variable inherit​_cache Indicate if this .HasCacheKey instance should make use of the cache key generation scheme used by its immediate superclass.
Class Method ​_generate​_cache​_attrs generate cache key dispatcher for a new class.
Class Method ​_generate​_cache​_key​_for​_object Undocumented
Method ​_gen​_cache​_key return an optional cache key.
Method ​_generate​_cache​_key return a cache key.
Class Variable ​_hierarchy​_supports​_caching private attribute which may be set to False to prevent the inherit_cache warning from being emitted for a hierarchy of subclasses.
Class Variable ​_is​_has​_cache​_key Undocumented

Inherited from InspectionAttr (via DescriptorProperty, MapperProperty):

Class Variable ​_is​_internal​_proxy True if this object is an internal proxy object.
Class Variable is​_aliased​_class True if this object is an instance of .AliasedClass.
Class Variable is​_attribute True if this object is a Python :term:`descriptor`.
Class Variable is​_bundle True if this object is an instance of .Bundle.
Class Variable is​_clause​_element True if this object is an instance of _expression.ClauseElement.
Class Variable is​_instance True if this object is an instance of .InstanceState.
Class Variable is​_mapper True if this object is an instance of _orm.Mapper.
Class Variable is​_selectable Return True if this object is an instance of _expression.Selectable.

Inherited from MemoizedSlots (via DescriptorProperty, MapperProperty):

Method __getattr__ Undocumented
Method ​_fallback​_getattr Undocumented
def __init__(self, class_, *attrs, **kwargs):

Return a composite column-based property for use with a Mapper.

See the mapping documentation section :ref:`mapper_composite` for a full usage example.

The .MapperProperty returned by .composite is the .CompositeProperty.

Parameters
class​_The "composite type" class, or any classmethod or callable which will produce a new instance of the composite object given the column values in order.
*attrsUndocumented
**kwargsUndocumented
colsList of Column objects to be mapped.
active_history=​FalseWhen True, indicates that the "previous" value for a scalar attribute should be loaded when replaced, if not already loaded. See the same flag on .column_property.
groupA group name for this property when marked as deferred.
deferredWhen True, the column property is "deferred", meaning that it does not load immediately, and is instead loaded when the attribute is first accessed on an instance. See also ~sqlalchemy.orm.deferred.
comparator​_factorya class which extends .CompositeProperty.Comparator which provides custom SQL clause generation for comparison operations.
docoptional string that will be applied as the doc on the class-bound descriptor.
infoOptional data dictionary which will be populated into the .MapperProperty.info attribute of this object.
def __str__(self):

Undocumented

def _comparator_factory(self, mapper):

Undocumented

def _create_descriptor(self):
Create the Python descriptor that will serve as the access point on instances of the mapped class.
def _setup_arguments_on_columns(self):
Propagate configuration arguments made on this composite to the target columns, for those that apply.
def _setup_event_handlers(self):
Establish events that populate/expire the composite attribute.
def do_init(self):
Initialization which occurs after the .CompositeProperty has been associated with its parent mapper.
def get_history(self, state, dict_, passive=attributes.PASSIVE_OFF):
Provided for userland code that uses attributes.get_history().
def instrument_class(self, mapper):

Hook called by the Mapper to the property to initiate instrumentation of the class attribute managed by this MapperProperty.

The MapperProperty here will typically call out to the attributes module to set up an InstrumentedAttribute.

This step is the first of two steps to set up an InstrumentedAttribute, and is called early in the mapper setup process.

The second step is typically the init_class_attribute step, called from StrategizedProperty via the post_instrument_class() hook. This step assigns additional state to the InstrumentedAttribute (specifically the "impl") which has been determined after the MapperProperty has determined what kind of persistence management it needs to do (e.g. scalar, object, collection, etc).

_COMPOSITE_FGET =

Undocumented

Value
object()
active_history =

Undocumented

attrs =

Undocumented

comparator_factory =

Undocumented

composite_class =

Undocumented

deferred =

Undocumented

group =

Undocumented

info =

Undocumented

@util.memoized_property
_attribute_keys =

Undocumented

@util.memoized_property
_comparable_elements =

Undocumented

@property
columns =

Undocumented

Undocumented