summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/automap.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-04-29 00:05:25 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-04-29 00:05:25 -0400
commit93b5eae9843d423378f68be928a4f1e6fcacfb87 (patch)
treeb68fac52e10fe2628ea435629a6483f1c3fa3099 /lib/sqlalchemy/ext/automap.py
parent4f6e9ccae93b9c50298b041356953cb8a96b4895 (diff)
downloadsqlalchemy-93b5eae9843d423378f68be928a4f1e6fcacfb87.tar.gz
- add boldface for "viable" plus a note describing that this
refers to the table having a primary key. fixes #3398
Diffstat (limited to 'lib/sqlalchemy/ext/automap.py')
-rw-r--r--lib/sqlalchemy/ext/automap.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/automap.py b/lib/sqlalchemy/ext/automap.py
index ca550ded6..448d8492e 100644
--- a/lib/sqlalchemy/ext/automap.py
+++ b/lib/sqlalchemy/ext/automap.py
@@ -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
=============================================