Defines the Mapper class, the central configurational unit which associates a class with a database table.
This is a semi-private module; the main configurational API of the ORM is available in module sqlalchemy.orm.
Given a class and optional entity_name, return the primary Mapper associated with the key.
If no mapper can be located, raises InvalidRequestError.
Given an object, return the primary Mapper associated with the object instance.
Define the correlation of class attributes to database table columns.
Instances of this class should be constructed via the mapper() function.
Construct a new mapper.
Mappers are normally constructed via the mapper() function. See for details.
Add the given dictionary of properties to this mapper, using add_property.
Add an individual MapperProperty to this mapper.
If the mapper has not been compiled yet, just adds the property to the initial properties dictionary sent to the constructor. If this Mapper has already been compiled, then the given MapperProperty is compiled immediately.
Iterate each element and its mapper in an object graph, for all relations that meet the given cascade rule.
the return value are object instances; this provides a strong reference so that they don't fall out of scope immediately.
Return true if the given mapper shares a common inherited parent as this mapper.
return a MapperProperty associated with the given key.
Return the mapper used for issuing selects.
This mapper is the same mapper as self unless the select_table argument was specified for this mapper.
Return the contextual session provided by the mapper extension chain, if any.
Raise InvalidRequestError if a session cannot be retrieved from the extension chain.
Return the identity key for the given instance, based on its primary key attributes.
This value is typically also found on the instance itself under the attribute name _instance_key.
Return an identity-map key for use in storing/retrieving an item from an identity map.
Return an identity-map key for use in storing/retrieving an item from the identity map.
Return a list of mapped instances corresponding to the rows in a given ResultProxy.
DEPRECATED.
Iterate through the collection including this mapper and all descendant mappers.
This includes not just the immediately inheriting mappers but all their inheriting mappers as well.
To iterate through an entire hierarchy, use mapper.base_mapper.polymorphic_iterator().
populate an instance from a result row.
Return the list of primary key values for the given instance.
Return the primary mapper corresponding to this mapper's class key (class + entity_name).
Translate the column keys of a row into a new or proxied row that can be understood by another mapper.
This can be used in conjunction with populate_instance to populate an instance using an alternate mapper.