class documentation

class Mapper(ORMFromClauseRole, ORMEntityColumnsClauseRole, sql_base.MemoizedHasCacheKey, InspectionAttr):

View In Hierarchy

Defines an association between a Python class and a database table or other relational structure, so that ORM operations against the class may proceed.

The _orm.Mapper object is instantiated using mapping methods present on the _orm.registry object. For information about instantiating new _orm.Mapper objects, see :ref:`orm_mapping_classes_toplevel`.

Method __clause​_element__ Undocumented
Method __init__ Direct constructor for a new _orm.Mapper object.
Method __repr__ Undocumented
Method __str__ Undocumented
Method ​_acceptable​_polymorphic​_identities Undocumented
Method ​_adapt​_inherited​_property Undocumented
Method ​_add​_with​_polymorphic​_subclass Undocumented
Method ​_all​_pk​_cols Undocumented
Method ​_canload Undocumented
Method ​_check​_configure Undocumented
Method ​_columns​_plus​_keys Undocumented
Method ​_compiled​_cache Undocumented
Method ​_configure​_class​_instrumentation If this mapper is to be a primary mapper (i.e. the non_primary flag is not set), associate this Mapper with the given class and entity name.
Method ​_configure​_inheritance Configure settings related to inheriting and/or inherited mappers being present.
Method ​_configure​_pks Undocumented
Method ​_configure​_polymorphic​_setter Configure an attribute on the mapper representing the 'polymorphic_on' column, if applicable, and not already generated by _configure_properties (which is typical).
Method ​_configure​_properties Undocumented
Method ​_configure​_property Undocumented
Method ​_dataclass​_fields Undocumented
Method ​_equivalent​_columns No summary
Method ​_expire​_memoizations Undocumented
Method ​_filter​_properties Undocumented
Method ​_gen​_cache​_key return an optional cache key.
Method ​_get​_clause create a "get clause" based on the primary key. this is used by query.get() and many-to-one lazyloads to load this item by primary key.
Method ​_get​_committed​_attr​_by​_column Undocumented
Method ​_get​_committed​_state​_attr​_by​_column Undocumented
Method ​_get​_state​_attr​_by​_column Undocumented
Method ​_identity​_key​_from​_state Undocumented
Method ​_identity​_key​_props Undocumented
Method ​_insert​_cols​_as​_none Undocumented
Method ​_insert​_cols​_evaluating​_none Undocumented
Method ​_is​_orphan Undocumented
Method ​_is​_userland​_descriptor Undocumented
Method ​_iterate​_polymorphic​_properties Return an iterator of MapperProperty objects which will render into a SELECT.
Method ​_iterate​_to​_target​_viawpoly Undocumented
Method ​_log Undocumented
Method ​_log​_debug Undocumented
Method ​_mappers​_from​_spec given a with_polymorphic() argument, return the set of mappers it represents.
Method ​_memo Undocumented
Method ​_optimized​_get​_statement assemble a WHERE clause which retrieves a given state by primary key, using a minimized set of tables.
Method ​_persistent​_sortkey​_fn Undocumented
Method ​_pk​_attr​_keys​_by​_table Undocumented
Method ​_pk​_keys​_by​_table Undocumented
Method ​_polymorphic​_adapter Undocumented
Method ​_polymorphic​_properties Undocumented
Method ​_post​_configure​_properties Call the init() method on all MapperProperties attached to this mapper.
Method ​_post​_inspect This hook is invoked by attribute inspection.
Method ​_primary​_key​_propkeys Undocumented
Method ​_prop​_set Undocumented
Method ​_property​_from​_column generate/update a .ColumnProperty given a _schema.Column object.
Method ​_propkey​_to​_col Undocumented
Method ​_result​_has​_identity​_key Undocumented
Method ​_selectable​_from​_mappers given a list of mappers (assumed to be within this mapper's inheritance hierarchy), construct an outerjoin amongst those mapper's mapped tables.
Method ​_server​_default​_cols Undocumented
Method ​_server​_default​_plus​_onupdate​_propkeys Undocumented
Method ​_server​_onupdate​_default​_cols Undocumented
Method ​_set​_committed​_state​_attr​_by​_column Undocumented
Method ​_set​_concrete​_base Set the given _orm.Mapper as the 'inherits' for this _orm.Mapper, assuming this _orm.Mapper is concrete and does not already have an inherits.
Method ​_set​_dispose​_flags Undocumented
Method ​_set​_polymorphic​_on Undocumented
Method ​_set​_state​_attr​_by​_column Undocumented
Method ​_set​_with​_polymorphic Undocumented
Method ​_should​_exclude determine whether a particular property should be implicitly present on the class.
Method ​_should​_selectin​_load Undocumented
Method ​_should​_undefer​_in​_wildcard Undocumented
Method ​_single​_table​_criterion Undocumented
Method ​_sorted​_tables Undocumented
Method ​_subclass​_load​_via​_in Assemble a that can load the columns local to this subclass as a SELECT with IN.
Method ​_subclass​_load​_via​_in​_mapper Undocumented
Method ​_version​_id​_prop Undocumented
Method ​_with​_polymorphic​_args Undocumented
Method ​_with​_polymorphic​_mappers Undocumented
Method ​_with​_polymorphic​_selectable Undocumented
Method add​_properties Add the given dictionary of properties to this mapper, using add_property.
Method add​_property Add an individual MapperProperty to this mapper.
Method all​_orm​_descriptors A namespace of all .InspectionAttr attributes associated with the mapped class.
Method attrs A namespace of all .MapperProperty objects associated this mapper.
Method cascade​_iterator Iterate each element and its mapper in an object graph, for all relationships that meet the given cascade rule.
Method column​_attrs Return a namespace of all .ColumnProperty properties maintained by this _orm.Mapper.
Method common​_parent Return true if the given mapper shares a common inherited parent as this mapper.
Method composites Return a namespace of all .CompositeProperty properties maintained by this _orm.Mapper.
Method get​_property return a MapperProperty associated with the given key.
Method get​_property​_by​_column Given a _schema.Column object, return the .MapperProperty which maps this column.
Method has​_property Undocumented
Method identity​_key​_from​_instance Return the identity key for the given instance, based on its primary key attributes.
Method identity​_key​_from​_primary​_key Return an identity-map key for use in storing/retrieving an item from an identity map.
Method identity​_key​_from​_row Return an identity-map key for use in storing/retrieving an item from the identity map.
Method is​_sibling return true if the other mapper is an inheriting sibling to this one. common parent but different branch
Method isa Return True if the this mapper inherits from the given mapper.
Method iterate​_to​_root Undocumented
Method polymorphic​_iterator Iterate through the collection including this mapper and all descendant mappers.
Method primary​_key​_from​_instance Return the list of primary key values for the given instance.
Method primary​_mapper Return the primary mapper corresponding to this mapper's class key (class).
Method relationships A namespace of all .RelationshipProperty properties maintained by this _orm.Mapper.
Method self​_and​_descendants The collection including this mapper and all descendant mappers.
Method synonyms Return a namespace of all .SynonymProperty properties maintained by this _orm.Mapper.
Class Variable is​_mapper Part of the inspection API.
Class Variable represents​_outer​_join Undocumented
Instance Variable ​_all​_tables Undocumented
Instance Variable ​_clause​_adapter Undocumented
Instance Variable ​_cols​_by​_table Undocumented
Instance Variable ​_columntoproperty Undocumented
Instance Variable ​_compiled​_cache​_size Undocumented
Instance Variable ​_delete​_orphans Undocumented
Instance Variable ​_dependency​_processors Undocumented
Instance Variable ​_dispose​_called Undocumented
Instance Variable ​_identity​_class Undocumented
Instance Variable ​_inheriting​_mappers Undocumented
Instance Variable ​_inherits​_equated​_pairs Undocumented
Instance Variable ​_init​_properties Undocumented
Instance Variable ​_memoized​_values Undocumented
Instance Variable ​_pks​_by​_table Undocumented
Instance Variable ​_primary​_key​_argument Undocumented
Instance Variable ​_props Undocumented
Instance Variable ​_readonly​_props Undocumented
Instance Variable ​_ready​_for​_configure Undocumented
Instance Variable ​_reconstructor Undocumented
Instance Variable ​_requires​_row​_aliasing Undocumented
Instance Variable ​_set​_polymorphic​_identity Undocumented
Instance Variable ​_sort​_key Undocumented
Instance Variable ​_validate​_polymorphic​_identity Undocumented
Instance Variable allow​_partial​_pks Undocumented
Instance Variable always​_refresh Undocumented
Instance Variable base​_mapper The base-most _orm.Mapper in an inheritance chain.
Instance Variable batch Undocumented
Instance Variable c A synonym for _orm.Mapper.columns.
Instance Variable class​_ The Python class which this _orm.Mapper maps.
Instance Variable class​_manager The .ClassManager which maintains event listeners and class-bound descriptors for this _orm.Mapper.
Instance Variable column​_prefix Undocumented
Instance Variable columns A collection of _schema.Column or other scalar expression objects maintained by this _orm.Mapper.
Instance Variable concrete Represent True if this _orm.Mapper is a concrete inheritance mapper.
Instance Variable configured Represent True if this _orm.Mapper has been configured.
Instance Variable confirm​_deleted​_rows Undocumented
Instance Variable eager​_defaults Undocumented
Instance Variable exclude​_properties Undocumented
Instance Variable include​_properties Undocumented
Instance Variable inherit​_condition Undocumented
Instance Variable inherit​_foreign​_keys Undocumented
Instance Variable inherits References the _orm.Mapper which this _orm.Mapper inherits from, if any.
Instance Variable legacy​_is​_orphan Undocumented
Instance Variable local​_table The _expression.Selectable which this _orm.Mapper manages.
Instance Variable non​_primary Represent True if this _orm.Mapper is a "non-primary" mapper, e.g. a mapper that is used only to select rows but not for persistence management.
Instance Variable passive​_deletes Undocumented
Instance Variable passive​_updates Undocumented
Instance Variable persist​_selectable The _expression.Selectable to which this _orm.Mapper is mapped.
Instance Variable polymorphic​_identity Represent an identifier which is matched against the _orm.Mapper.polymorphic_on column during result row loading.
Instance Variable polymorphic​_load Undocumented
Instance Variable polymorphic​_map A mapping of "polymorphic identity" identifiers mapped to _orm.Mapper instances, within an inheritance scenario.
Instance Variable polymorphic​_on The _schema.Column or SQL expression specified as the polymorphic_on argument for this _orm.Mapper, within an inheritance scenario.
Instance Variable primary​_key No summary
Instance Variable registry Undocumented
Instance Variable single Represent True if this _orm.Mapper is a single table inheritance mapper.
Instance Variable tables An iterable containing the collection of _schema.Table objects which this _orm.Mapper is aware of.
Instance Variable validators An immutable dictionary of attributes which have been decorated using the _orm.validates decorator.
Instance Variable version​_id​_col Undocumented
Instance Variable version​_id​_generator Undocumented
Instance Variable version​_id​_prop Undocumented
Instance Variable with​_polymorphic Undocumented
Property ​_all​_column​_expressions Undocumented
Property ​_log​_desc Undocumented
Property ​_path​_registry Undocumented
Property ​_table​_to​_equated memoized map of tables to collections of columns to be synchronized upwards to the base mapper.
Property entity Part of the inspection API.
Property entity​_namespace Undocumented
Property iterate​_properties return an iterator of all MapperProperty objects.
Property mapped​_table Undocumented
Property mapper Part of the inspection API.
Property primary​_base​_mapper Undocumented
Property select​_identity​_token Undocumented
Property selectable The _schema.FromClause construct this _orm.Mapper selects from by default.

Inherited from ORMFromClauseRole:

Class Variable ​_role​_name Undocumented

Inherited from StrictFromClauseRole (via ORMFromClauseRole):

Property description Undocumented

Inherited from FromClauseRole (via ORMFromClauseRole, StrictFromClauseRole):

Class Variable ​_is​_subquery Undocumented
Property ​_hide​_froms Undocumented

Inherited from ColumnsClauseRole (via ORMFromClauseRole, StrictFromClauseRole, FromClauseRole):

Property ​_select​_iterable Undocumented

Inherited from AllowsLambdaRole (via ORMFromClauseRole, StrictFromClauseRole, FromClauseRole, ColumnsClauseRole):

Class Variable allows​_lambda Undocumented

Inherited from UsesInspection (via ORMFromClauseRole, StrictFromClauseRole, FromClauseRole, ColumnsClauseRole):

Class Variable uses​_inspection Undocumented

Inherited from SQLRole (via ORMFromClauseRole, StrictFromClauseRole, FromClauseRole, ColumnsClauseRole, ColumnListRole):

Class Variable allows​_lambda Undocumented
Class Variable uses​_inspection Undocumented

Inherited from AllowsLambdaRole (via ORMFromClauseRole, StrictFromClauseRole, FromClauseRole, JoinTargetRole):

Class Variable allows​_lambda Undocumented

Inherited from UsesInspection (via ORMFromClauseRole, StrictFromClauseRole, FromClauseRole, JoinTargetRole):

Class Variable uses​_inspection Undocumented

Inherited from SQLRole (via ORMFromClauseRole, StrictFromClauseRole, FromClauseRole, JoinTargetRole, StructuralRole):

Class Variable allows​_lambda Undocumented
Class Variable uses​_inspection Undocumented

Inherited from ORMEntityColumnsClauseRole:

Class Variable ​_role​_name Undocumented

Inherited from ColumnsClauseRole (via ORMEntityColumnsClauseRole, ORMColumnsClauseRole):

Property ​_select​_iterable Undocumented

Inherited from AllowsLambdaRole (via ORMEntityColumnsClauseRole, ORMColumnsClauseRole, ColumnsClauseRole):

Class Variable allows​_lambda Undocumented

Inherited from UsesInspection (via ORMEntityColumnsClauseRole, ORMColumnsClauseRole, ColumnsClauseRole):

Class Variable uses​_inspection Undocumented

Inherited from SQLRole (via ORMEntityColumnsClauseRole, ORMColumnsClauseRole, ColumnsClauseRole, ColumnListRole):

Class Variable allows​_lambda Undocumented
Class Variable uses​_inspection Undocumented

Inherited from MemoizedHasCacheKey:

Method ​_generate​_cache​_key return a cache key.

Inherited from HasCacheKey (via MemoizedHasCacheKey):

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
Class Variable __slots__ Undocumented
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
@HasMemoized.memoized_instancemethod
def __clause_element__(self):

Undocumented

@util.deprecated_params(non_primary=('1.3', 'The :paramref:`.mapper.non_primary` parameter is deprecated, and will be removed in a future release. The functionality of non primary mappers is now better suited using the :class:`.AliasedClass` construct, which can also be used as the target of a :func:`_orm.relationship` in 1.3.'))
def __init__(self, class_, local_table=None, properties=None, primary_key=None, non_primary=False, inherits=None, inherit_condition=None, inherit_foreign_keys=None, always_refresh=False, version_id_col=None, version_id_generator=None, polymorphic_on=None, _polymorphic_map=None, polymorphic_identity=None, concrete=False, with_polymorphic=None, polymorphic_load=None, allow_partial_pks=True, batch=True, column_prefix=None, include_properties=None, exclude_properties=None, passive_updates=True, passive_deletes=False, confirm_deleted_rows=True, eager_defaults=False, legacy_is_orphan=False, _compiled_cache_size=100):

Direct constructor for a new _orm.Mapper object.

The _orm.mapper function is normally invoked through the use of the _orm.registry object through either the :ref:`Declarative <orm_declarative_mapping>` or :ref:`Imperative <orm_imperative_mapping>` mapping styles.

Changed in version 1.4: The _orm.mapper function should not be called directly for classical mapping; for a classical mapping configuration, use the _orm.registry.map_imperatively method. The _orm.mapper function may become private in a future release.

Parameters documented below may be passed to either the _orm.registry.map_imperatively method, or may be passed in the __mapper_args__ declarative class attribute described at :ref:`orm_declarative_mapper_options`.

Parameters
class​_The class to be mapped. When using Declarative, this argument is automatically passed as the declared class itself.
local​_tableThe _schema.Table or other selectable to which the class is mapped. May be None if this mapper inherits from another mapper using single-table inheritance. When using Declarative, this argument is automatically passed by the extension, based on what is configured via the __table__ argument or via the _schema.Table produced as a result of the __tablename__ and _schema.Column arguments present.
propertiesA dictionary mapping the string names of object attributes to .MapperProperty instances, which define the persistence behavior of that attribute. Note that _schema.Column objects present in the mapped _schema.Table are automatically placed into ColumnProperty instances upon mapping, unless overridden. When using Declarative, this argument is passed automatically, based on all those .MapperProperty instances declared in the declared class body.
primary​_keyA list of _schema.Column objects which define the primary key to be used against this mapper's selectable unit. This is normally simply the primary key of the local_table, but can be overridden here.
non​_primary
Specify that this _orm.Mapper
is in addition to the "primary" mapper, that is, the one used for persistence. The _orm.Mapper created here may be used for ad-hoc mapping of the class to an alternate selectable, for loading only.

See Also

:ref:`relationship_aliased_class` - the new pattern that removes the need for the :paramref:`_orm.Mapper.non_primary` flag.

inherits

A mapped class or the corresponding _orm.Mapper of one indicating a superclass to which this _orm.Mapper should inherit from. The mapped class here must be a subclass of the other mapper's class. When using Declarative, this argument is passed automatically as a result of the natural class hierarchy of the declared classes.

inherit​_conditionFor joined table inheritance, a SQL expression which will define how the two tables are joined; defaults to a natural join between the two tables.
inherit​_foreign​_keysWhen inherit_condition is used and the columns present are missing a _schema.ForeignKey configuration, this parameter can be used to specify which columns are "foreign". In most cases can be left as None.
always​_refreshIf True, all query operations for this mapped class will overwrite all data within object instances that already exist within the session, erasing any in-memory changes with whatever information was loaded from the database. Usage of this flag is highly discouraged; as an alternative, see the method _query.Query.populate_existing.
version​_id​_col

A _schema.Column that will be used to keep a running version id of rows in the table. This is used to detect concurrent updates or the presence of stale data in a flush. The methodology is to detect if an UPDATE statement does not match the last known version id, a ~sqlalchemy.orm.exc.StaleDataError exception is thrown. By default, the column must be of .Integer type, unless version_id_generator specifies an alternative version generator.

See Also

:ref:`mapper_version_counter` - discussion of version counting and rationale.

version​_id​_generator

Define how new version ids should be generated. Defaults to None, which indicates that a simple integer counting scheme be employed. To provide a custom versioning scheme, provide a callable function of the form:

def generate_version(version):
    return next_version

Alternatively, server-side versioning functions such as triggers, or programmatic versioning schemes outside of the version id generator may be used, by specifying the value False. Please see :ref:`server_side_version_counter` for a discussion of important points when using this option.

New in version 0.9.0: version_id_generator supports server-side version number generation.
polymorphic​_on

Specifies the column, attribute, or SQL expression used to determine the target class for an incoming row, when inheriting classes are present.

This value is commonly a _schema.Column object that's present in the mapped _schema.Table:

class Employee(Base):
    __tablename__ = 'employee'

    id = Column(Integer, primary_key=True)
    discriminator = Column(String(50))

    __mapper_args__ = {
        "polymorphic_on":discriminator,
        "polymorphic_identity":"employee"
    }

It may also be specified as a SQL expression, as in this example where we use the .case construct to provide a conditional approach:

class Employee(Base):
    __tablename__ = 'employee'

    id = Column(Integer, primary_key=True)
    discriminator = Column(String(50))

    __mapper_args__ = {
        "polymorphic_on":case([
            (discriminator == "EN", "engineer"),
            (discriminator == "MA", "manager"),
        ], else_="employee"),
        "polymorphic_identity":"employee"
    }

It may also refer to any attribute configured with .column_property, or to the string name of one:

class Employee(Base):
    __tablename__ = 'employee'

    id = Column(Integer, primary_key=True)
    discriminator = Column(String(50))
    employee_type = column_property(
        case([
            (discriminator == "EN", "engineer"),
            (discriminator == "MA", "manager"),
        ], else_="employee")
    )

    __mapper_args__ = {
        "polymorphic_on":employee_type,
        "polymorphic_identity":"employee"
    }

When setting polymorphic_on to reference an attribute or expression that's not present in the locally mapped _schema.Table, yet the value of the discriminator should be persisted to the database, the value of the discriminator is not automatically set on new instances; this must be handled by the user, either through manual means or via event listeners. A typical approach to establishing such a listener looks like:

from sqlalchemy import event
from sqlalchemy.orm import object_mapper

@event.listens_for(Employee, "init", propagate=True)
def set_identity(instance, *arg, **kw):
    mapper = object_mapper(instance)
    instance.discriminator = mapper.polymorphic_identity

Where above, we assign the value of polymorphic_identity for the mapped class to the discriminator attribute, thus persisting the value to the discriminator column in the database.

Warning

Currently, only one discriminator column may be set, typically on the base-most class in the hierarchy. "Cascading" polymorphic columns are not yet supported.

​_polymorphic​_mapUndocumented
polymorphic​_identitySpecifies the value which identifies this particular class as returned by the column expression referred to by the polymorphic_on setting. As rows are received, the value corresponding to the polymorphic_on column expression is compared to this value, indicating which subclass should be used for the newly reconstructed object.
concrete

If True, indicates this mapper should use concrete table inheritance with its parent mapper.

See the section :ref:`concrete_inheritance` for an example.

with​_polymorphic

A tuple in the form (<classes>, <selectable>) indicating the default style of "polymorphic" loading, that is, which tables are queried at once. <classes> is any single or list of mappers and/or classes indicating the inherited classes that should be loaded at once. The special value '*' may be used to indicate all descending classes should be loaded immediately. The second tuple argument <selectable> indicates a selectable that will be used to query for multiple classes.

See Also

:ref:`with_polymorphic` - discussion of polymorphic querying techniques.

polymorphic​_load
Specifies "polymorphic loading" behavior

for a subclass in an inheritance hierarchy (joined and single table inheritance only). Valid values are:

  • "'inline'" - specifies this class should be part of the "with_polymorphic" mappers, e.g. its columns will be included in a SELECT query against the base.
  • "'selectin'" - specifies that when instances of this class are loaded, an additional SELECT will be emitted to retrieve the columns specific to this subclass. The SELECT uses IN to fetch multiple subclasses at once.
New in version 1.2.
allow​_partial​_pksDefaults to True. Indicates that a composite primary key with some NULL values should be considered as possibly existing within the database. This affects whether a mapper will assign an incoming row to an existing identity, as well as if .Session.merge will check the database first for a particular primary key value. A "partial primary key" can occur if one has mapped to an OUTER JOIN, for example.
batchDefaults to True, indicating that save operations of multiple entities can be batched together for efficiency. Setting to False indicates that an instance will be fully saved before saving the next instance. This is used in the extremely rare case that a .MapperEvents listener requires being called in between individual row persistence operations.
column​_prefix

A string which will be prepended to the mapped attribute name when _schema.Column objects are automatically assigned as attributes to the mapped class. Does not affect explicitly specified column-based properties.

See the section :ref:`column_prefix` for an example.

include​_properties

An inclusive list or set of string column names to map.

See :ref:`include_exclude_cols` for an example.

exclude​_properties

A list or set of string column names to be excluded from mapping.

See :ref:`include_exclude_cols` for an example.

passive​_updates

Indicates UPDATE behavior of foreign key columns when a primary key column changes on a joined-table inheritance mapping. Defaults to True.

When True, it is assumed that ON UPDATE CASCADE is configured on the foreign key in the database, and that the database will handle propagation of an UPDATE from a source column to dependent columns on joined-table rows.

When False, it is assumed that the database does not enforce referential integrity and will not be issuing its own CASCADE operation for an update. The unit of work process will emit an UPDATE statement for the dependent columns during a primary key change.

See Also

:ref:`passive_updates` - description of a similar feature as used with _orm.relationship

:paramref:`.mapper.passive_deletes` - supporting ON DELETE CASCADE for joined-table inheritance mappers

passive​_deletes

Indicates DELETE behavior of foreign key columns when a joined-table inheritance entity is being deleted. Defaults to False for a base mapper; for an inheriting mapper, defaults to False unless the value is set to True on the superclass mapper.

When True, it is assumed that ON DELETE CASCADE is configured on the foreign key relationships that link this mapper's table to its superclass table, so that when the unit of work attempts to delete the entity, it need only emit a DELETE statement for the superclass table, and not this table.

When False, a DELETE statement is emitted for this mapper's table individually. If the primary key attributes local to this table are unloaded, then a SELECT must be emitted in order to validate these attributes; note that the primary key columns of a joined-table subclass are not part of the "primary key" of the object as a whole.

Note that a value of True is always forced onto the subclass mappers; that is, it's not possible for a superclass to specify passive_deletes without this taking effect for all subclass mappers.

New in version 1.1.

See Also

:ref:`passive_deletes` - description of similar feature as used with _orm.relationship

:paramref:`.mapper.passive_updates` - supporting ON UPDATE CASCADE for joined-table inheritance mappers

confirm​_deleted​_rows

defaults to True; when a DELETE occurs of one more rows based on specific primary keys, a warning is emitted when the number of rows matched does not equal the number of rows expected. This parameter may be set to False to handle the case where database ON DELETE CASCADE rules may be deleting some of those rows automatically. The warning may be changed to an exception in a future release.

New in version 0.9.4: - added :paramref:`.mapper.confirm_deleted_rows` as well as conditional matched row checking on delete.
eager​_defaults

if True, the ORM will immediately fetch the value of server-generated default values after an INSERT or UPDATE, rather than leaving them as expired to be fetched on next access. This can be used for event schemes where the server-generated values are needed immediately before the flush completes. By default, this scheme will emit an individual SELECT statement per row inserted or updated, which note can add significant performance overhead. However, if the target database supports :term:`RETURNING`, the default values will be returned inline with the INSERT or UPDATE statement, which can greatly enhance performance for an application that needs frequent access to just-generated server defaults.

Changed in version 0.9.0: The eager_defaults option can now make use of :term:`RETURNING` for backends which support it.
legacy​_is​_orphan

Boolean, defaults to False. When True, specifies that "legacy" orphan consideration is to be applied to objects mapped by this mapper, which means that a pending (that is, not persistent) object is auto-expunged from an owning .Session only when it is de-associated from all parents that specify a delete-orphan cascade towards this mapper. The new default behavior is that the object is auto-expunged when it is de-associated with any of its parents that specify delete-orphan cascade. This behavior is more consistent with that of a persistent object, and allows behavior to be consistent in more scenarios independently of whether or not an orphan object has been flushed yet or not.

See the change note and example at :ref:`legacy_is_orphan_addition` for more detail on this change.

​_compiled​_cache​_sizeUndocumented
def __repr__(self):

Undocumented

def __str__(self):

Undocumented

@HasMemoized.memoized_attribute
def _acceptable_polymorphic_identities(self):

Undocumented

@util.preload_module('sqlalchemy.orm.descriptor_props')
def _adapt_inherited_property(self, key, prop, init):

Undocumented

def _add_with_polymorphic_subclass(self, mapper):

Undocumented

@HasMemoized.memoized_attribute
def _all_pk_cols(self):

Undocumented

def _canload(self, state, allow_subtypes):

Undocumented

def _check_configure(self):

Undocumented

def _columns_plus_keys(self, polymorphic_mappers=()):

Undocumented

@HasMemoized.memoized_attribute
def _compiled_cache(self):

Undocumented

def _configure_class_instrumentation(self):

If this mapper is to be a primary mapper (i.e. the non_primary flag is not set), associate this Mapper with the given class and entity name.

Subsequent calls to class_mapper() for the class_ / entity name combination will return this mapper. Also decorate the __init__ method on the mapped class to include optional auto-session attachment logic.

def _configure_inheritance(self):
Configure settings related to inheriting and/or inherited mappers being present.
def _configure_pks(self):

Undocumented

def _configure_polymorphic_setter(self, init=False):

Configure an attribute on the mapper representing the 'polymorphic_on' column, if applicable, and not already generated by _configure_properties (which is typical).

Also create a setter function which will assign this attribute to the value of the 'polymorphic_identity' upon instance construction, also if applicable. This routine will run when an instance is created.

def _configure_properties(self):

Undocumented

@util.preload_module('sqlalchemy.orm.descriptor_props')
def _configure_property(self, key, prop, init=True, setparent=True):

Undocumented

@HasMemoized.memoized_attribute
def _dataclass_fields(self):

Undocumented

@HasMemoized.memoized_attribute
def _equivalent_columns(self):

Create a map of all equivalent columns, based on the determination of column pairs that are equated to one another based on inherit condition. This is designed to work with the queries that util.polymorphic_union comes up with, which often don't include the columns from the base table directly (including the subclass table columns only).

The resulting structure is a dictionary of columns mapped to lists of equivalent columns, e.g.:

{
    tablea.col1:
        {tableb.col1, tablec.col1},
    tablea.col2:
        {tabled.col2}
}
def _expire_memoizations(self):

Undocumented

def _filter_properties(self, type_):

Undocumented

def _gen_cache_key(self, anon_map, bindparams):

return an optional cache key.

The cache key is a tuple which can contain any series of objects that are hashable and also identifies this object uniquely within the presence of a larger SQL expression or statement, for the purposes of caching the resulting query.

The cache key should be based on the SQL compiled structure that would ultimately be produced. That is, two structures that are composed in exactly the same way should produce the same cache key; any difference in the structures that would affect the SQL string or the type handlers should result in a different cache key.

If a structure cannot produce a useful cache key, the NO_CACHE symbol should be added to the anon_map and the method should return None.

@HasMemoized.memoized_attribute
def _get_clause(self):
create a "get clause" based on the primary key. this is used by query.get() and many-to-one lazyloads to load this item by primary key.
def _get_committed_attr_by_column(self, obj, column):

Undocumented

def _get_committed_state_attr_by_column(self, state, dict_, column, passive=attributes.PASSIVE_RETURN_NO_VALUE):

Undocumented

def _get_state_attr_by_column(self, state, dict_, column, passive=attributes.PASSIVE_RETURN_NO_VALUE):

Undocumented

def _identity_key_from_state(self, state, passive=attributes.PASSIVE_RETURN_NO_VALUE):

Undocumented

@HasMemoized.memoized_attribute
def _identity_key_props(self):

Undocumented

@HasMemoized.memoized_attribute
def _insert_cols_as_none(self):

Undocumented

@HasMemoized.memoized_attribute
def _insert_cols_evaluating_none(self):

Undocumented

def _is_orphan(self, state):

Undocumented

def _is_userland_descriptor(self, assigned_name, obj):

Undocumented

def _iterate_polymorphic_properties(self, mappers=None):
Return an iterator of MapperProperty objects which will render into a SELECT.
def _iterate_to_target_viawpoly(self, mapper):

Undocumented

def _log(self, msg, *args):

Undocumented

def _log_debug(self, msg, *args):

Undocumented

def _mappers_from_spec(self, spec, selectable):

given a with_polymorphic() argument, return the set of mappers it represents.

Trims the list of mappers to just those represented within the given selectable, if present. This helps some more legacy-ish mappings.

def _memo(self, key, callable_):

Undocumented

def _optimized_get_statement(self, state, attribute_names):

assemble a WHERE clause which retrieves a given state by primary key, using a minimized set of tables.

Applies to a joined-table inheritance mapper where the requested attribute names are only present on joined tables, not the base table. The WHERE clause attempts to include only those tables to minimize joins.

@HasMemoized.memoized_attribute
def _persistent_sortkey_fn(self):

Undocumented

@HasMemoized.memoized_attribute
def _pk_attr_keys_by_table(self):

Undocumented

@HasMemoized.memoized_attribute
def _pk_keys_by_table(self):

Undocumented

@HasMemoized.memoized_attribute
def _polymorphic_adapter(self):

Undocumented

@HasMemoized.memoized_attribute
def _polymorphic_properties(self):

Undocumented

def _post_configure_properties(self):

Call the init() method on all MapperProperties attached to this mapper.

This is a deferred configuration step which is intended to execute once all mappers have been constructed.

@HasMemoized.memoized_attribute
def _post_inspect(self):

This hook is invoked by attribute inspection.

E.g. when Query calls:

coercions.expect(roles.ColumnsClauseRole, ent, keep_inspect=True)

This allows the inspection process run a configure mappers hook.

@HasMemoized.memoized_attribute
def _primary_key_propkeys(self):

Undocumented

@HasMemoized.memoized_attribute
def _prop_set(self):

Undocumented

@util.preload_module('sqlalchemy.orm.descriptor_props')
def _property_from_column(self, key, prop):
generate/update a .ColumnProperty given a _schema.Column object.
@HasMemoized.memoized_attribute
def _propkey_to_col(self):

Undocumented

def _result_has_identity_key(self, result, adapter=None):

Undocumented

def _selectable_from_mappers(self, mappers, innerjoin):
given a list of mappers (assumed to be within this mapper's inheritance hierarchy), construct an outerjoin amongst those mapper's mapped tables.
@HasMemoized.memoized_attribute
def _server_default_cols(self):

Undocumented

@HasMemoized.memoized_attribute
def _server_default_plus_onupdate_propkeys(self):

Undocumented

@HasMemoized.memoized_attribute
def _server_onupdate_default_cols(self):

Undocumented

def _set_committed_state_attr_by_column(self, state, dict_, column, value):

Undocumented

def _set_concrete_base(self, mapper):
Set the given _orm.Mapper as the 'inherits' for this _orm.Mapper, assuming this _orm.Mapper is concrete and does not already have an inherits.
def _set_dispose_flags(self):

Undocumented

def _set_polymorphic_on(self, polymorphic_on):

Undocumented

def _set_state_attr_by_column(self, state, dict_, column, value):

Undocumented

def _set_with_polymorphic(self, with_polymorphic):

Undocumented

def _should_exclude(self, name, assigned_name, local, column):

determine whether a particular property should be implicitly present on the class.

This occurs when properties are propagated from an inherited class, or are applied from the columns present in the mapped table.

def _should_selectin_load(self, enabled_via_opt, polymorphic_from):

Undocumented

@HasMemoized.memoized_attribute
def _should_undefer_in_wildcard(self):

Undocumented

@HasMemoized.memoized_attribute
def _single_table_criterion(self):

Undocumented

@HasMemoized.memoized_attribute
def _sorted_tables(self):

Undocumented

@util.preload_module('sqlalchemy.orm.strategy_options')
def _subclass_load_via_in(self, entity):
Assemble a that can load the columns local to this subclass as a SELECT with IN.
@HasMemoized.memoized_attribute
def _subclass_load_via_in_mapper(self):

Undocumented

@HasMemoized.memoized_attribute
def _version_id_prop(self):

Undocumented

def _with_polymorphic_args(self, spec=None, selectable=False, innerjoin=False):

Undocumented

@HasMemoized.memoized_attribute
def _with_polymorphic_mappers(self):

Undocumented

@HasMemoized.memoized_attribute
def _with_polymorphic_selectable(self):

Undocumented

def add_properties(self, dict_of_properties):
Add the given dictionary of properties to this mapper, using add_property.
def add_property(self, key, prop):

Add an individual MapperProperty to this mapper.

If the mapper has not been configured yet, just adds the property to the initial properties dictionary sent to the constructor. If this Mapper has already been configured, then the given MapperProperty is configured immediately.

@HasMemoized.memoized_attribute
def all_orm_descriptors(self):

A namespace of all .InspectionAttr attributes associated with the mapped class.

These attributes are in all cases Python :term:`descriptors` associated with the mapped class or its superclasses.

This namespace includes attributes that are mapped to the class as well as attributes declared by extension modules. It includes any Python descriptor type that inherits from .InspectionAttr. This includes .QueryableAttribute, as well as extension types such as .hybrid_property, .hybrid_method and .AssociationProxy.

To distinguish between mapped attributes and extension attributes, the attribute .InspectionAttr.extension_type will refer to a constant that distinguishes between different extension types.

The sorting of the attributes is based on the following rules:

  1. Iterate through the class and its superclasses in order from subclass to superclass (i.e. iterate through cls.__mro__)
  2. For each class, yield the attributes in the order in which they appear in __dict__, with the exception of those in step 3 below. In Python 3.6 and above this ordering will be the same as that of the class' construction, with the exception of attributes that were added after the fact by the application or the mapper.
  3. If a certain attribute key is also in the superclass __dict__, then it's included in the iteration for that class, and not the class in which it first appeared.

The above process produces an ordering that is deterministic in terms of the order in which attributes were assigned to the class.

Changed in version 1.3.19: ensured deterministic ordering for _orm.Mapper.all_orm_descriptors.

When dealing with a .QueryableAttribute, the .QueryableAttribute.property attribute refers to the .MapperProperty property, which is what you get when referring to the collection of mapped properties via _orm.Mapper.attrs.

Warning

The _orm.Mapper.all_orm_descriptors accessor namespace is an instance of .OrderedProperties. This is a dictionary-like object which includes a small number of named methods such as .OrderedProperties.items and .OrderedProperties.values. When accessing attributes dynamically, favor using the dict-access scheme, e.g. mapper.all_orm_descriptors[somename] over getattr(mapper.all_orm_descriptors, somename) to avoid name collisions.

See Also

_orm.Mapper.attrs

@HasMemoized.memoized_attribute
def attrs(self):

A namespace of all .MapperProperty objects associated this mapper.

This is an object that provides each property based on its key name. For instance, the mapper for a User class which has User.name attribute would provide mapper.attrs.name, which would be the .ColumnProperty representing the name column. The namespace object can also be iterated, which would yield each .MapperProperty.

_orm.Mapper has several pre-filtered views of this attribute which limit the types of properties returned, including .synonyms, .column_attrs, .relationships, and .composites.

Warning

The _orm.Mapper.attrs accessor namespace is an instance of .OrderedProperties. This is a dictionary-like object which includes a small number of named methods such as .OrderedProperties.items and .OrderedProperties.values. When accessing attributes dynamically, favor using the dict-access scheme, e.g. mapper.attrs[somename] over getattr(mapper.attrs, somename) to avoid name collisions.

See Also

_orm.Mapper.all_orm_descriptors

def cascade_iterator(self, type_, state, halt_on=None):

Iterate each element and its mapper in an object graph, for all relationships that meet the given cascade rule.

See Also

:ref:`unitofwork_cascades`

:ref:`faq_walk_objects` - illustrates a generic function to traverse all objects without relying on cascades.

Parameters
type​_

The name of the cascade rule (i.e. "save-update", "delete", etc.).

Note

the "all" cascade is not accepted here. For a generic object traversal function, see :ref:`faq_walk_objects`.

stateThe lead InstanceState. child items will be processed per the relationships defined for this object's mapper.
halt​_onUndocumented
Returns
the method yields individual object instances.
@HasMemoized.memoized_attribute
def column_attrs(self):

Return a namespace of all .ColumnProperty properties maintained by this _orm.Mapper.

See Also

_orm.Mapper.attrs - namespace of all .MapperProperty objects.

def common_parent(self, other):
Return true if the given mapper shares a common inherited parent as this mapper.
@HasMemoized.memoized_attribute
@util.preload_module('sqlalchemy.orm.descriptor_props')
def composites(self):

Return a namespace of all .CompositeProperty properties maintained by this _orm.Mapper.

See Also

_orm.Mapper.attrs - namespace of all .MapperProperty objects.

def get_property(self, key, _configure_mappers=True):
return a MapperProperty associated with the given key.
def get_property_by_column(self, column):
Given a _schema.Column object, return the .MapperProperty which maps this column.
def has_property(self, key):

Undocumented

def identity_key_from_instance(self, instance):

Return the identity key for the given instance, based on its primary key attributes.

If the instance's state is expired, calling this method will result in a database check to see if the object has been deleted. If the row no longer exists, ~sqlalchemy.orm.exc.ObjectDeletedError is raised.

This value is typically also found on the instance state under the attribute name key.

def identity_key_from_primary_key(self, primary_key, identity_token=None):
Return an identity-map key for use in storing/retrieving an item from an identity map.
Parameters
primary​_keyA list of values indicating the identifier.
identity​_tokenUndocumented
def identity_key_from_row(self, row, identity_token=None, adapter=None):
Return an identity-map key for use in storing/retrieving an item from the identity map.
Parameters
rowA .Row instance. The columns which are mapped by this _orm.Mapper should be locatable in the row, preferably via the _schema.Column object directly (as is the case when a _expression.select construct is executed), or via string names of the form <tablename>_<colname>.
identity​_tokenUndocumented
adapterUndocumented
def is_sibling(self, other):
return true if the other mapper is an inheriting sibling to this one. common parent but different branch
def isa(self, other):
Return True if the this mapper inherits from the given mapper.
def iterate_to_root(self):

Undocumented

def polymorphic_iterator(self):

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().

def primary_key_from_instance(self, instance):

Return the list of primary key values for the given instance.

If the instance's state is expired, calling this method will result in a database check to see if the object has been deleted. If the row no longer exists, ~sqlalchemy.orm.exc.ObjectDeletedError is raised.

def primary_mapper(self):
Return the primary mapper corresponding to this mapper's class key (class).
@util.preload_module('sqlalchemy.orm.relationships')
@HasMemoized.memoized_attribute
def relationships(self):

A namespace of all .RelationshipProperty properties maintained by this _orm.Mapper.

Warning

the _orm.Mapper.relationships accessor namespace is an instance of .OrderedProperties. This is a dictionary-like object which includes a small number of named methods such as .OrderedProperties.items and .OrderedProperties.values. When accessing attributes dynamically, favor using the dict-access scheme, e.g. mapper.relationships[somename] over getattr(mapper.relationships, somename) to avoid name collisions.

See Also

_orm.Mapper.attrs - namespace of all .MapperProperty objects.

@HasMemoized.memoized_attribute
def self_and_descendants(self):

The collection including this mapper and all descendant mappers.

This includes not just the immediately inheriting mappers but all their inheriting mappers as well.

@HasMemoized.memoized_attribute
@util.preload_module('sqlalchemy.orm.descriptor_props')
def synonyms(self):

Return a namespace of all .SynonymProperty properties maintained by this _orm.Mapper.

See Also

_orm.Mapper.attrs - namespace of all .MapperProperty objects.

is_mapper: bool =
Part of the inspection API.
represents_outer_join: bool =

Undocumented

_all_tables =

Undocumented

_clause_adapter =

Undocumented

_cols_by_table: dict =

Undocumented

_columntoproperty =

Undocumented

_compiled_cache_size =

Undocumented

_delete_orphans: list =

Undocumented

_dependency_processors: list =

Undocumented

_dispose_called: bool =

Undocumented

_identity_class =

Undocumented

_inheriting_mappers =

Undocumented

_inherits_equated_pairs =

Undocumented

_init_properties =

Undocumented

_memoized_values: dict =

Undocumented

_pks_by_table: dict =

Undocumented

_primary_key_argument =

Undocumented

_props =

Undocumented

_readonly_props =

Undocumented

_ready_for_configure: bool =

Undocumented

_reconstructor =

Undocumented

_requires_row_aliasing: bool =

Undocumented

_set_polymorphic_identity =

Undocumented

_sort_key =

Undocumented

_validate_polymorphic_identity =

Undocumented

allow_partial_pks =

Undocumented

always_refresh =

Undocumented

base_mapper =

The base-most _orm.Mapper in an inheritance chain.

In a non-inheriting scenario, this attribute will always be this _orm.Mapper. In an inheritance scenario, it references the _orm.Mapper which is parent to all other _orm.Mapper objects in the inheritance chain.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

batch =

Undocumented

c =
A synonym for _orm.Mapper.columns.
class_ =

The Python class which this _orm.Mapper maps.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

class_manager =

The .ClassManager which maintains event listeners and class-bound descriptors for this _orm.Mapper.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

column_prefix =

Undocumented

columns =

A collection of _schema.Column or other scalar expression objects maintained by this _orm.Mapper.

The collection behaves the same as that of the c attribute on any _schema.Table object, except that only those columns included in this mapping are present, and are keyed based on the attribute name defined in the mapping, not necessarily the key attribute of the _schema.Column itself. Additionally, scalar expressions mapped by .column_property are also present here.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

concrete =

Represent True if this _orm.Mapper is a concrete inheritance mapper.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

configured: bool =

Represent True if this _orm.Mapper has been configured.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

See Also

.configure_mappers.

confirm_deleted_rows: bool =

Undocumented

eager_defaults =

Undocumented

exclude_properties =

Undocumented

include_properties =

Undocumented

inherit_condition =

Undocumented

inherit_foreign_keys =

Undocumented

inherits =

References the _orm.Mapper which this _orm.Mapper inherits from, if any.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

legacy_is_orphan =

Undocumented

local_table =

The _expression.Selectable which this _orm.Mapper manages.

Typically is an instance of _schema.Table or _expression.Alias. May also be None.

The "local" table is the selectable that the _orm.Mapper is directly responsible for managing from an attribute access and flush perspective. For non-inheriting mappers, the local table is the same as the "mapped" table. For joined-table inheritance mappers, local_table will be the particular sub-table of the overall "join" which this _orm.Mapper represents. If this mapper is a single-table inheriting mapper, local_table will be None.

See Also

_orm.Mapper.persist_selectable.

non_primary =

Represent True if this _orm.Mapper is a "non-primary" mapper, e.g. a mapper that is used only to select rows but not for persistence management.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

passive_deletes =

Undocumented

passive_updates =

Undocumented

persist_selectable =

The _expression.Selectable to which this _orm.Mapper is mapped.

Typically an instance of _schema.Table, _expression.Join, or _expression.Alias.

The _orm.Mapper.persist_selectable is separate from _orm.Mapper.selectable in that the former represents columns that are mapped on this class or its superclasses, whereas the latter may be a "polymorphic" selectable that contains additional columns which are in fact mapped on subclasses only.

"persist selectable" is the "thing the mapper writes to" and "selectable" is the "thing the mapper selects from".

_orm.Mapper.persist_selectable is also separate from _orm.Mapper.local_table, which represents the set of columns that are locally mapped on this class directly.

See Also

_orm.Mapper.selectable.

_orm.Mapper.local_table.

polymorphic_identity =

Represent an identifier which is matched against the _orm.Mapper.polymorphic_on column during result row loading.

Used only with inheritance, this object can be of any type which is comparable to the type of column represented by _orm.Mapper.polymorphic_on.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

polymorphic_load =

Undocumented

polymorphic_map =

A mapping of "polymorphic identity" identifiers mapped to _orm.Mapper instances, within an inheritance scenario.

The identifiers can be of any type which is comparable to the type of column represented by _orm.Mapper.polymorphic_on.

An inheritance chain of mappers will all reference the same polymorphic map object. The object is used to correlate incoming result rows to target mappers.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

polymorphic_on =

The _schema.Column or SQL expression specified as the polymorphic_on argument for this _orm.Mapper, within an inheritance scenario.

This attribute is normally a _schema.Column instance but may also be an expression, such as one derived from .cast.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

primary_key =

An iterable containing the collection of _schema.Column objects which comprise the 'primary key' of the mapped table, from the perspective of this _orm.Mapper.

This list is against the selectable in _orm.Mapper.persist_selectable. In the case of inheriting mappers, some columns may be managed by a superclass mapper. For example, in the case of a _expression.Join, the primary key is determined by all of the primary key columns across all tables referenced by the _expression.Join.

The list is also not necessarily the same as the primary key column collection associated with the underlying tables; the _orm.Mapper features a primary_key argument that can override what the _orm.Mapper considers as primary key columns.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

registry =

Undocumented

single: bool =

Represent True if this _orm.Mapper is a single table inheritance mapper.

_orm.Mapper.local_table will be None if this flag is set.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

tables =

An iterable containing the collection of _schema.Table objects which this _orm.Mapper is aware of.

If the mapper is mapped to a _expression.Join, or an _expression.Alias representing a _expression.Select, the individual _schema.Table objects that comprise the full construct will be represented here.

This is a read only attribute determined during mapper construction. Behavior is undefined if directly modified.

validators =

An immutable dictionary of attributes which have been decorated using the _orm.validates decorator.

The dictionary contains string attribute names as keys mapped to the actual validation method.

version_id_col =

Undocumented

version_id_generator =

Undocumented

version_id_prop =

Undocumented

with_polymorphic =

Undocumented

@property
_all_column_expressions =

Undocumented

@property
_log_desc =

Undocumented

@util.memoized_property
_path_registry =

Undocumented

@util.memoized_property
_table_to_equated =
memoized map of tables to collections of columns to be synchronized upwards to the base mapper.
@property
entity =

Part of the inspection API.

Returns self.class_.

@property
entity_namespace =

Undocumented

@property
iterate_properties =
return an iterator of all MapperProperty objects.
@property
@util.deprecated('1.3', 'Use .persist_selectable')
mapped_table =

Undocumented

@property
mapper =

Part of the inspection API.

Returns self.

@property
primary_base_mapper =

Undocumented

@util.memoized_property
select_identity_token =

Undocumented

@property
selectable =

The _schema.FromClause construct this _orm.Mapper selects from by default.

Normally, this is equivalent to .persist_selectable, unless the with_polymorphic feature is in use, in which case the full "polymorphic" selectable is returned.