From 74bec18c2a3cc8e9c031808fc44bc0f2c5af8b43 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 7 Mar 2017 14:54:53 -0500 Subject: - document ForeignKeyConstraint columns / elements, fixes #2904 Change-Id: Ia50a3100d1bd88020c30224932b16aeadd7f4c75 --- lib/sqlalchemy/sql/schema.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 08f23c4af..e6eabc461 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -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) -- cgit v1.2.1