]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
update stale documentation on Mapper class
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 4 Jan 2022 20:38:15 +0000 (15:38 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 4 Jan 2022 20:39:06 +0000 (15:39 -0500)
don't get into details here that have changed,
point to the main narrative documentation instead.

Change-Id: I5bc0829f6ff282ca104f18deb9ec9857b6e1c8ac
(cherry picked from commit 9298ce03e1181d5bc00c1891663433606ead1223)

lib/sqlalchemy/orm/mapper.py

index 9ac18bea664046c29caa50a3894bca88a43856b4..af63c52399811cfa7b9a177ae9728525651b7b1f 100644 (file)
@@ -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`.
 
     """