]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- document ForeignKeyConstraint columns / elements, fixes #2904
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 7 Mar 2017 19:54:53 +0000 (14:54 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 7 Mar 2017 19:54:53 +0000 (14:54 -0500)
Change-Id: Ia50a3100d1bd88020c30224932b16aeadd7f4c75

doc/build/core/constraints.rst
lib/sqlalchemy/sql/schema.py

index b350038b6a92fe47b8e650a1edded009df3e877d..aff684f0ab3d278660b151331fc25cf192b41718 100644 (file)
@@ -725,7 +725,6 @@ Constraints API
     :members:
     :inherited-members:
 
-
 .. autoclass:: PrimaryKeyConstraint
     :members:
     :inherited-members:
index 08f23c4af7cf6110431ddf1f97c3b20dad147b7a..e6eabc46199d2d483fe0a510d8b05d2ff13e0c25 100644 (file)
@@ -2630,6 +2630,12 @@ class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint):
         Constraint.__init__(self, **kw)
         ColumnCollectionMixin.__init__(self, *columns, _autoattach=_autoattach)
 
+    columns = None
+    """A :class:`.ColumnCollection` representing the set of columns
+    for this constraint.
+
+    """
+
     def _set_parent(self, table):
         Constraint._set_parent(self, table)
         ColumnCollectionMixin._set_parent(self, table)
@@ -2871,6 +2877,22 @@ class ForeignKeyConstraint(ColumnCollectionConstraint):
         self.columns.add(column)
         self.elements.append(fk)
 
+    columns = None
+    """A :class:`.ColumnCollection` representing the set of columns
+    for this constraint.
+
+    """
+
+    elements = None
+    """A sequence of :class:`.ForeignKey` objects.
+
+    Each :class:`.ForeignKey` represents a single referring column/referred
+    column pair.
+
+    This collection is intended to be read-only.
+
+    """
+
     @property
     def _elements(self):
         # legacy - provide a dictionary view of (column_key, fk)