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 sqlalchemy.orm.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 indiviual 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.
Execute a callable for each element in an object graph, for all relations that meet the given cascade rule.
Iterate each element in an object graph, for all relations taht meet the given cascade rule.
Return true if the given mapper shares a common inherited parent as this mapper.
Compile this mapper into its final internal format.
This is the external version of the method which is not reentrant.
Issue DELETE statements for a list of objects.
This is called within the context of a UOWTransaction during a flush operation.
Return an instance attribute using a Column as the key.
return MapperProperty 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.
Return True if this mapper handles the given instance.
This is dependent not only on class assignment but the optional entity_name parameter as well.
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).
Register DependencyProcessor instances with a unitofwork.UOWTransaction.
This call register_dependencies on all attached MapperProperty instances.
Issue INSERT and/or UPDATE statements for a list of objects.
This is called within the context of a UOWTransaction during a flush operation.
save_obj issues SQL statements not just for instances mapped directly by this mapper, but for instances mapped by all inheriting mappers as well. This is to maintain proper insert ordering among a polymorphic chain of instances. Therefore save_obj is typically called only on a base mapper, or a mapper which does not inherit from any other mapper.
Set the value of an instance attribute using a Column as the key.
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.