From: Mike Bayer Date: Tue, 4 Jan 2022 20:38:15 +0000 (-0500) Subject: update stale documentation on Mapper class X-Git-Tag: rel_2_0_0b1~561 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9298ce03e1181d5bc00c1891663433606ead1223;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git update stale documentation on Mapper class don't get into details here that have changed, point to the main narrative documentation instead. Change-Id: I5bc0829f6ff282ca104f18deb9ec9857b6e1c8ac --- diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 272329c30f..21da7c2f30 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -91,35 +91,14 @@ class Mapper( sql_base.MemoizedHasCacheKey, InspectionAttr, ): - """Define the correlation of class attributes to database table - columns. + """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 :class:`_orm.Mapper` object is instantiated using the - :func:`~sqlalchemy.orm.mapper` function. For information + The :class:`_orm.Mapper` object is instantiated using mapping methods + present on the :class:`_orm.registry` object. For information about instantiating new :class:`_orm.Mapper` objects, see - that function's documentation. - - - When :func:`.mapper` is used - explicitly to link a user defined class with table - metadata, this is referred to as *classical mapping*. - Modern SQLAlchemy usage tends to favor the - :mod:`sqlalchemy.ext.declarative` extension for class - configuration, which - makes usage of :func:`.mapper` behind the scenes. - - Given a particular class known to be mapped by the ORM, - the :class:`_orm.Mapper` which maintains it can be acquired - using the :func:`_sa.inspect` function:: - - from sqlalchemy import inspect - - mapper = inspect(MyClass) - - A class which was mapped by the :mod:`sqlalchemy.ext.declarative` - extension will also have its mapper available via the ``__mapper__`` - attribute. - + :ref:`orm_mapping_classes_toplevel`. """