summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-11-25 18:01:31 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-11-25 18:01:31 -0500
commit212d93366d1c5c3a8e44f8b428eeece6258ae28f (patch)
treefa75fbed92f1e899b98cda73911c7936c790871e /lib/sqlalchemy/sql/compiler.py
parentde11f9498258182cbb6668b72067ec3f43a90415 (diff)
downloadsqlalchemy-212d93366d1c5c3a8e44f8b428eeece6258ae28f.tar.gz
- The behavioral contract of the :attr:`.ForeignKeyConstraint.columns`
collection has been made consistent; this attribute is now a :class:`.ColumnCollection` like that of all other constraints and is initialized at the point when the constraint is associated with a :class:`.Table`. fixes #3243
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 8f3ede25f..b102f0240 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -2286,14 +2286,14 @@ class DDLCompiler(Compiled):
formatted_name = self.preparer.format_constraint(constraint)
if formatted_name is not None:
text += "CONSTRAINT %s " % formatted_name
- remote_table = list(constraint._elements.values())[0].column.table
+ remote_table = list(constraint.elements)[0].column.table
text += "FOREIGN KEY(%s) REFERENCES %s (%s)" % (
', '.join(preparer.quote(f.parent.name)
- for f in constraint._elements.values()),
+ for f in constraint.elements),
self.define_constraint_remote_table(
constraint, remote_table, preparer),
', '.join(preparer.quote(f.column.name)
- for f in constraint._elements.values())
+ for f in constraint.elements)
)
text += self.define_constraint_match(constraint)
text += self.define_constraint_cascades(constraint)