summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-07-01 17:09:57 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-07-01 17:09:57 -0400
commited633ffce1c88d323c85fdea8c564035a271e6bb (patch)
tree79e7532151276fcf631dcb3683608572569189bb /doc
parente936a7b359a205e0476b932a1f175f5da7289e06 (diff)
downloadsqlalchemy-ed633ffce1c88d323c85fdea8c564035a271e6bb.tar.gz
- add doc to schema docs linking to declarative usage of __table__
- add more examples to __table__ such as that asked on a recent stackoverflow question.
Diffstat (limited to 'doc')
-rw-r--r--doc/build/core/schema.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/build/core/schema.rst b/doc/build/core/schema.rst
index 58105f160..dc1011bc1 100644
--- a/doc/build/core/schema.rst
+++ b/doc/build/core/schema.rst
@@ -1062,6 +1062,19 @@ MySQL.
CONSTRAINT check1 CHECK (col2 > col3 + 5)
){stop}
+Setting up Constraints when using the Declarative ORM Extension
+----------------------------------------------------------------
+
+The :class:`.Table` is the SQLAlchemy Core construct that allows one to define
+table metadata, which among other things can be used by the SQLAlchemy ORM
+as a target to map a class. The :ref:`Declarative <declarative_toplevel>`
+extension allows the :class:`.Table` object to be created automatically, given
+the contents of the table primarily as a mapping of :class:`.Column` objects.
+
+To apply table-level constraint objects such as :class:`.ForeignKeyConstraint`
+to a table defined using Declarative, use the ``__table_args__`` attribute,
+described at :ref:`declarative_table_args`.
+
Constraints API
---------------
.. autoclass:: Constraint