]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- add boldface for "viable" plus a note describing that this
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 29 Apr 2015 04:05:25 +0000 (00:05 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 29 Apr 2015 04:05:25 +0000 (00:05 -0400)
refers to the table having a primary key.  fixes #3398

lib/sqlalchemy/ext/automap.py

index ca550ded64ca3c57fe6b7de145f1ceaa3c51ebf7..448d8492e21e0595412f9b72d7b397ad503f94c9 100644 (file)
@@ -67,7 +67,7 @@ asking it to reflect the schema and produce mappings::
 Above, calling :meth:`.AutomapBase.prepare` while passing along the
 :paramref:`.AutomapBase.prepare.reflect` parameter indicates that the
 :meth:`.MetaData.reflect` method will be called on this declarative base
-classes' :class:`.MetaData` collection; then, each viable
+classes' :class:`.MetaData` collection; then, each **viable**
 :class:`.Table` within the :class:`.MetaData` will get a new mapped class
 generated automatically.  The :class:`.ForeignKeyConstraint` objects which
 link the various tables together will be used to produce new, bidirectional
@@ -76,6 +76,12 @@ follow along a default naming scheme that we can customize.  At this point,
 our basic mapping consisting of related ``User`` and ``Address`` classes is
 ready to use in the traditional way.
 
+.. note:: By **viable**, we mean that for a table to be mapped, it must
+   specify a primary key.  Additionally, if the table is detected as being
+   a pure association table between two other tables, it will not be directly
+   mapped and will instead be configured as a many-to-many table between
+   the mappings for the two referring tables.
+
 Generating Mappings from an Existing MetaData
 =============================================