diff options
Diffstat (limited to 'lib/sqlalchemy/orm/mapper.py')
-rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 227 |
1 files changed, 124 insertions, 103 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 3e4c3a5d5..31f005769 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -74,9 +74,9 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """Define the correlation of class attributes to database table columns. - The :class:`.Mapper` object is instantiated using the + The :class:`_orm.Mapper` object is instantiated using the :func:`~sqlalchemy.orm.mapper` function. For information - about instantiating new :class:`.Mapper` objects, see + about instantiating new :class:`_orm.Mapper` objects, see that function's documentation. @@ -89,8 +89,8 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): makes usage of :func:`.mapper` behind the scenes. Given a particular class known to be mapped by the ORM, - the :class:`.Mapper` which maintains it can be acquired - using the :func:`.inspect` function:: + the :class:`_orm.Mapper` which maintains it can be acquired + using the :func:`_sa.inspect` function:: from sqlalchemy import inspect @@ -113,7 +113,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): "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:`.relationship` in 1.3.", + "as the target of a :func:`_orm.relationship` in 1.3.", ), ) def __init__( @@ -147,7 +147,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): legacy_is_orphan=False, _compiled_cache_size=100, ): - r"""Return a new :class:`~.Mapper` object. + r"""Return a new :class:`_orm.Mapper` object. This function is typically used behind the scenes via the Declarative extension. When using Declarative, @@ -196,21 +196,22 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): this argument is automatically passed as the declared class itself. - :param local_table: The :class:`.Table` or other selectable + :param local_table: The :class:`_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 - :class:`.Table` produced as a result of the ``__tablename__`` - and :class:`.Column` arguments present. + :class:`_schema.Table` + produced as a result of the ``__tablename__`` + and :class:`_schema.Column` arguments present. :param always_refresh: If 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 - :meth:`.Query.populate_existing`. + :meth:`_query.Query.populate_existing`. :param allow_partial_pks: Defaults to True. Indicates that a composite primary key with some NULL values should be considered as @@ -229,7 +230,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): in between individual row persistence operations. :param column_prefix: A string which will be prepended - to the mapped attribute name when :class:`.Column` + to the mapped attribute name when :class:`_schema.Column` objects are automatically assigned as attributes to the mapped class. Does not affect explicitly specified column-based properties. @@ -283,8 +284,9 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): See :ref:`include_exclude_cols` for an example. - :param inherits: A mapped class or the corresponding :class:`.Mapper` - of one indicating a superclass to which this :class:`.Mapper` + :param inherits: A mapped class or the corresponding + :class:`_orm.Mapper` + of one indicating a superclass to which this :class:`_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 @@ -300,7 +302,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): between the two tables. :param inherit_foreign_keys: When ``inherit_condition`` is used and - the columns present are missing a :class:`.ForeignKey` + the columns present are missing a :class:`_schema.ForeignKey` configuration, this parameter can be used to specify which columns are "foreign". In most cases can be left as ``None``. @@ -320,14 +322,15 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): See the change note and example at :ref:`legacy_is_orphan_addition` for more detail on this change. - :param non_primary: Specify that this :class:`.Mapper` is in addition + :param non_primary: Specify that this :class:`_orm.Mapper` + is in addition to the "primary" mapper, that is, the one used for persistence. - The :class:`.Mapper` created here may be used for ad-hoc + The :class:`_orm.Mapper` created here may be used for ad-hoc mapping of the class to an alternate selectable, for loading only. - :paramref:`.Mapper.non_primary` is not an often used option, but - is useful in some specific :func:`.relationship` cases. + :paramref:`_orm.Mapper.non_primary` is not an often used option, but + is useful in some specific :func:`_orm.relationship` cases. .. seealso:: @@ -362,7 +365,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): .. seealso:: :ref:`passive_deletes` - description of similar feature as - used with :func:`.relationship` + used with :func:`_orm.relationship` :paramref:`.mapper.passive_updates` - supporting ON UPDATE CASCADE for joined-table inheritance mappers @@ -385,7 +388,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): .. seealso:: :ref:`passive_updates` - description of a similar feature as - used with :func:`.relationship` + used with :func:`_orm.relationship` :paramref:`.mapper.passive_deletes` - supporting ON DELETE CASCADE for joined-table inheritance mappers @@ -415,8 +418,8 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): SQL expression used to determine the target class for an incoming row, when inheriting classes are present. - This value is commonly a :class:`.Column` object that's - present in the mapped :class:`.Table`:: + This value is commonly a :class:`_schema.Column` object that's + present in the mapped :class:`_schema.Table`:: class Employee(Base): __tablename__ = 'employee' @@ -471,7 +474,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): When setting ``polymorphic_on`` to reference an attribute or expression that's not present in the - locally mapped :class:`.Table`, yet the value + locally mapped :class:`_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 @@ -513,20 +516,22 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): :param properties: A dictionary mapping the string names of object attributes to :class:`.MapperProperty` instances, which define the - persistence behavior of that attribute. Note that :class:`.Column` + persistence behavior of that attribute. Note that + :class:`_schema.Column` objects present in - the mapped :class:`.Table` are automatically placed into + the mapped :class:`_schema.Table` are automatically placed into ``ColumnProperty`` instances upon mapping, unless overridden. When using Declarative, this argument is passed automatically, based on all those :class:`.MapperProperty` instances declared in the declared class body. - :param primary_key: A list of :class:`.Column` objects which define + :param primary_key: A list of :class:`_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. - :param version_id_col: A :class:`.Column` + :param version_id_col: A :class:`_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 @@ -721,34 +726,38 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): return self.class_ local_table = None - """The :class:`.Selectable` which this :class:`.Mapper` manages. + """The :class:`expression.Selectable` which this :class:`_orm.Mapper` + manages. - Typically is an instance of :class:`.Table` or :class:`.Alias`. + Typically is an instance of :class:`_schema.Table` or + :class:`_expression.Alias`. May also be ``None``. The "local" table is the - selectable that the :class:`.Mapper` is directly responsible for + selectable that the :class:`_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 :class:`.Mapper` represents. If this mapper is a + this :class:`_orm.Mapper` represents. If this mapper is a single-table inheriting mapper, local_table will be ``None``. .. seealso:: - :attr:`~.Mapper.persist_selectable`. + :attr:`_orm.Mapper.persist_selectable`. """ persist_selectable = None - """The :class:`.Selectable` to which this :class:`.Mapper` is mapped. + """The :class:`expression.Selectable` to which this :class:`_orm.Mapper` + is mapped. - Typically an instance of :class:`.Table`, :class:`.Join`, or - :class:`.Alias`. + Typically an instance of :class:`_schema.Table`, :class:`_expression.Join` + , or + :class:`_expression.Alias`. - The :attr:`.Mapper.persist_selectable` is separate from - :attr:`.Mapper.selectable` in that the former represents columns + The :attr:`_orm.Mapper.persist_selectable` is separate from + :attr:`_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. @@ -756,21 +765,21 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): "persist selectable" is the "thing the mapper writes to" and "selectable" is the "thing the mapper selects from". - :attr:`.Mapper.persist_selectable` is also separate from - :attr:`.Mapper.local_table`, which represents the set of columns that + :attr:`_orm.Mapper.persist_selectable` is also separate from + :attr:`_orm.Mapper.local_table`, which represents the set of columns that are locally mapped on this class directly. .. seealso:: - :attr:`~.Mapper.selectable`. + :attr:`_orm.Mapper.selectable`. - :attr:`~.Mapper.local_table`. + :attr:`_orm.Mapper.local_table`. """ inherits = None - """References the :class:`.Mapper` which this :class:`.Mapper` + """References the :class:`_orm.Mapper` which this :class:`_orm.Mapper` inherits from, if any. This is a *read only* attribute determined during mapper construction. @@ -779,7 +788,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ configured = None - """Represent ``True`` if this :class:`.Mapper` has been configured. + """Represent ``True`` if this :class:`_orm.Mapper` has been configured. This is a *read only* attribute determined during mapper construction. Behavior is undefined if directly modified. @@ -791,7 +800,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ concrete = None - """Represent ``True`` if this :class:`.Mapper` is a concrete + """Represent ``True`` if this :class:`_orm.Mapper` is a concrete inheritance mapper. This is a *read only* attribute determined during mapper construction. @@ -800,11 +809,13 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ tables = None - """An iterable containing the collection of :class:`.Table` objects - which this :class:`.Mapper` is aware of. + """An iterable containing the collection of :class:`_schema.Table` objects + which this :class:`_orm.Mapper` is aware of. - If the mapper is mapped to a :class:`.Join`, or an :class:`.Alias` - representing a :class:`.Select`, the individual :class:`.Table` + If the mapper is mapped to a :class:`_expression.Join`, or an + :class:`_expression.Alias` + representing a :class:`_expression.Select`, the individual + :class:`_schema.Table` objects that comprise the full construct will be represented here. This is a *read only* attribute determined during mapper construction. @@ -813,20 +824,23 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ primary_key = None - """An iterable containing the collection of :class:`.Column` objects + """An iterable containing the collection of :class:`_schema.Column` + objects which comprise the 'primary key' of the mapped table, from the - perspective of this :class:`.Mapper`. + perspective of this :class:`_orm.Mapper`. - This list is against the selectable in :attr:`~.Mapper.persist_selectable`. + This list is against the selectable in + :attr:`_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 :class:`.Join`, the + superclass mapper. For example, in the case of a + :class:`_expression.Join`, the primary key is determined by all of the primary key columns across all - tables referenced by the :class:`.Join`. + tables referenced by the :class:`_expression.Join`. The list is also not necessarily the same as the primary key column - collection associated with the underlying tables; the :class:`.Mapper` + collection associated with the underlying tables; the :class:`_orm.Mapper` features a ``primary_key`` argument that can override what the - :class:`.Mapper` considers as primary key columns. + :class:`_orm.Mapper` considers as primary key columns. This is a *read only* attribute determined during mapper construction. Behavior is undefined if directly modified. @@ -834,7 +848,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ class_ = None - """The Python class which this :class:`.Mapper` maps. + """The Python class which this :class:`_orm.Mapper` maps. This is a *read only* attribute determined during mapper construction. Behavior is undefined if directly modified. @@ -843,7 +857,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): class_manager = None """The :class:`.ClassManager` which maintains event listeners - and class-bound descriptors for this :class:`.Mapper`. + and class-bound descriptors for this :class:`_orm.Mapper`. This is a *read only* attribute determined during mapper construction. Behavior is undefined if directly modified. @@ -851,10 +865,10 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ single = None - """Represent ``True`` if this :class:`.Mapper` is a single table + """Represent ``True`` if this :class:`_orm.Mapper` is a single table inheritance mapper. - :attr:`~.Mapper.local_table` will be ``None`` if this flag is set. + :attr:`_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. @@ -862,7 +876,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ non_primary = None - """Represent ``True`` if this :class:`.Mapper` is a "non-primary" + """Represent ``True`` if this :class:`_orm.Mapper` is a "non-primary" mapper, e.g. a mapper that is used only to select rows but not for persistence management. @@ -872,11 +886,11 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ polymorphic_on = None - """The :class:`.Column` or SQL expression specified as the + """The :class:`_schema.Column` or SQL expression specified as the ``polymorphic_on`` argument - for this :class:`.Mapper`, within an inheritance scenario. + for this :class:`_orm.Mapper`, within an inheritance scenario. - This attribute is normally a :class:`.Column` instance but + This attribute is normally a :class:`_schema.Column` instance but may also be an expression, such as one derived from :func:`.cast`. @@ -887,10 +901,10 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): polymorphic_map = None """A mapping of "polymorphic identity" identifiers mapped to - :class:`.Mapper` instances, within an inheritance scenario. + :class:`_orm.Mapper` instances, within an inheritance scenario. The identifiers can be of any type which is comparable to the - type of column represented by :attr:`~.Mapper.polymorphic_on`. + type of column represented by :attr:`_orm.Mapper.polymorphic_on`. An inheritance chain of mappers will all reference the same polymorphic map object. The object is used to correlate incoming @@ -903,11 +917,11 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): polymorphic_identity = None """Represent an identifier which is matched against the - :attr:`~.Mapper.polymorphic_on` column during result row loading. + :attr:`_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 - :attr:`~.Mapper.polymorphic_on`. + :attr:`_orm.Mapper.polymorphic_on`. This is a *read only* attribute determined during mapper construction. Behavior is undefined if directly modified. @@ -915,11 +929,11 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ base_mapper = None - """The base-most :class:`.Mapper` in an inheritance chain. + """The base-most :class:`_orm.Mapper` in an inheritance chain. In a non-inheriting scenario, this attribute will always be this - :class:`.Mapper`. In an inheritance scenario, it references - the :class:`.Mapper` which is parent to all other :class:`.Mapper` + :class:`_orm.Mapper`. In an inheritance scenario, it references + the :class:`_orm.Mapper` which is parent to all other :class:`_orm.Mapper` objects in the inheritance chain. This is a *read only* attribute determined during mapper construction. @@ -928,14 +942,15 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ columns = None - """A collection of :class:`.Column` or other scalar expression - objects maintained by this :class:`.Mapper`. + """A collection of :class:`_schema.Column` or other scalar expression + objects maintained by this :class:`_orm.Mapper`. The collection behaves the same as that of the ``c`` attribute on - any :class:`.Table` object, except that only those columns included in + any :class:`_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 - :class:`.Column` itself. Additionally, scalar expressions mapped + :class:`_schema.Column` itself. Additionally, scalar expressions mapped by :func:`.column_property` are also present here. This is a *read only* attribute determined during mapper construction. @@ -945,7 +960,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): validators = None """An immutable dictionary of attributes which have been decorated - using the :func:`~.orm.validates` decorator. + using the :func:`_orm.validates` decorator. The dictionary contains string attribute names as keys mapped to the actual validation method. @@ -953,7 +968,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): """ c = None - """A synonym for :attr:`~.Mapper.columns`.""" + """A synonym for :attr:`_orm.Mapper.columns`.""" @property @util.deprecated("1.3", "Use .persist_selectable") @@ -1139,8 +1154,8 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): ) def _set_concrete_base(self, mapper): - """Set the given :class:`.Mapper` as the 'inherits' for this - :class:`.Mapper`, assuming this :class:`.Mapper` is concrete + """Set the given :class:`_orm.Mapper` as the 'inherits' for this + :class:`_orm.Mapper`, assuming this :class:`_orm.Mapper` is concrete and does not already have an inherits.""" assert self.concrete @@ -1778,7 +1793,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): @util.preload_module("sqlalchemy.orm.descriptor_props") def _property_from_column(self, key, prop): """generate/update a :class:`.ColumnProperty` given a - :class:`.Column` object. """ + :class:`_schema.Column` object. """ descriptor_props = util.preloaded.orm_descriptor_props # we were passed a Column or a list of Columns; # generate a properties.ColumnProperty @@ -1979,7 +1994,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): ) def get_property_by_column(self, column): - """Given a :class:`.Column` object, return the + """Given a :class:`_schema.Column` object, return the :class:`.MapperProperty` which maps this column.""" return self._columntoproperty[column] @@ -2083,7 +2098,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): ) with_polymorphic_mappers = _with_polymorphic_mappers - """The list of :class:`.Mapper` objects included in the + """The list of :class:`_orm.Mapper` objects included in the default "polymorphic" query. """ @@ -2201,8 +2216,8 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): @property def selectable(self): - """The :func:`~.sql.expression.select` construct this - :class:`.Mapper` selects from by default. + """The :func:`_expression.select` construct this + :class:`_orm.Mapper` selects from by default. Normally, this is equivalent to :attr:`.persist_selectable`, unless the ``with_polymorphic`` feature is in use, in which case the @@ -2281,14 +2296,14 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): column. The namespace object can also be iterated, which would yield each :class:`.MapperProperty`. - :class:`.Mapper` has several pre-filtered views + :class:`_orm.Mapper` has several pre-filtered views of this attribute which limit the types of properties returned, including :attr:`.synonyms`, :attr:`.column_attrs`, :attr:`.relationships`, and :attr:`.composites`. .. warning:: - The :attr:`.Mapper.attrs` accessor namespace is an + The :attr:`_orm.Mapper.attrs` accessor namespace is an instance of :class:`.OrderedProperties`. This is a dictionary-like object which includes a small number of named methods such as :meth:`.OrderedProperties.items` @@ -2299,7 +2314,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): .. seealso:: - :attr:`.Mapper.all_orm_descriptors` + :attr:`_orm.Mapper.all_orm_descriptors` """ if Mapper._new_mappers: @@ -2330,11 +2345,12 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): :attr:`.QueryableAttribute.property` attribute refers to the :class:`.MapperProperty` property, which is what you get when referring to the collection of mapped properties via - :attr:`.Mapper.attrs`. + :attr:`_orm.Mapper.attrs`. .. warning:: - The :attr:`.Mapper.all_orm_descriptors` accessor namespace is an + The :attr:`_orm.Mapper.all_orm_descriptors` + accessor namespace is an instance of :class:`.OrderedProperties`. This is a dictionary-like object which includes a small number of named methods such as :meth:`.OrderedProperties.items` @@ -2346,7 +2362,7 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): .. seealso:: - :attr:`.Mapper.attrs` + :attr:`_orm.Mapper.attrs` """ return util.ImmutableProperties( @@ -2357,11 +2373,12 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): @util.preload_module("sqlalchemy.orm.descriptor_props") def synonyms(self): """Return a namespace of all :class:`.SynonymProperty` - properties maintained by this :class:`.Mapper`. + properties maintained by this :class:`_orm.Mapper`. .. seealso:: - :attr:`.Mapper.attrs` - namespace of all :class:`.MapperProperty` + :attr:`_orm.Mapper.attrs` - namespace of all + :class:`.MapperProperty` objects. """ @@ -2372,11 +2389,12 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): @HasMemoized.memoized_attribute def column_attrs(self): """Return a namespace of all :class:`.ColumnProperty` - properties maintained by this :class:`.Mapper`. + properties maintained by this :class:`_orm.Mapper`. .. seealso:: - :attr:`.Mapper.attrs` - namespace of all :class:`.MapperProperty` + :attr:`_orm.Mapper.attrs` - namespace of all + :class:`.MapperProperty` objects. """ @@ -2386,11 +2404,11 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): @HasMemoized.memoized_attribute def relationships(self): """A namespace of all :class:`.RelationshipProperty` properties - maintained by this :class:`.Mapper`. + maintained by this :class:`_orm.Mapper`. .. warning:: - the :attr:`.Mapper.relationships` accessor namespace is an + the :attr:`_orm.Mapper.relationships` accessor namespace is an instance of :class:`.OrderedProperties`. This is a dictionary-like object which includes a small number of named methods such as :meth:`.OrderedProperties.items` @@ -2402,7 +2420,8 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): .. seealso:: - :attr:`.Mapper.attrs` - namespace of all :class:`.MapperProperty` + :attr:`_orm.Mapper.attrs` - namespace of all + :class:`.MapperProperty` objects. """ @@ -2414,11 +2433,12 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): @util.preload_module("sqlalchemy.orm.descriptor_props") def composites(self): """Return a namespace of all :class:`.CompositeProperty` - properties maintained by this :class:`.Mapper`. + properties maintained by this :class:`_orm.Mapper`. .. seealso:: - :attr:`.Mapper.attrs` - namespace of all :class:`.MapperProperty` + :attr:`_orm.Mapper.attrs` - namespace of all + :class:`.MapperProperty` objects. """ @@ -2638,9 +2658,10 @@ class Mapper(sql_base.HasCacheKey, InspectionAttr): item from the identity map. :param row: A :class:`.Row` instance. The columns which are - mapped by this :class:`.Mapper` should be locatable in the row, - preferably via the :class:`.Column` object directly (as is the case - when a :func:`~.sql.expression.select` construct is executed), or + mapped by this :class:`_orm.Mapper` should be locatable in the row, + preferably via the :class:`_schema.Column` + object directly (as is the case + when a :func:`_expression.select` construct is executed), or via string names of the form ``<tablename>_<colname>``. """ @@ -3157,13 +3178,13 @@ def configure_mappers(): proceeds. * :meth:`.MapperEvents.mapper_configured` - called as each individual - :class:`.Mapper` is configured within the process; will include all + :class:`_orm.Mapper` is configured within the process; will include all mapper state except for backrefs set up by other mappers that are still to be configured. * :meth:`.MapperEvents.after_configured` - called once after :func:`.configure_mappers` is complete; at this stage, all - :class:`.Mapper` objects that are known to SQLAlchemy will be fully + :class:`_orm.Mapper` objects that are known to SQLAlchemy will be fully configured. Note that the calling application may still have other mappings that haven't been produced yet, such as if they are in modules as yet unimported. |