diff options
author | Tom Farvour <tom@farvour.com> | 2014-02-05 15:40:55 -0600 |
---|---|---|
committer | Tom Farvour <tom@farvour.com> | 2014-02-05 15:40:55 -0600 |
commit | d006198e17fcbed65d88aeaa940ce512e95a6fff (patch) | |
tree | be106723d3fa62f2ea23d6a89de90bc346527d8e /lib/sqlalchemy/sql/naming.py | |
parent | 16cd07c4f896b03d0e73fc28b5279421dab53489 (diff) | |
download | sqlalchemy-pr/67.tar.gz |
Add naming convention support when using schema in the metadata.pr/67
Diffstat (limited to 'lib/sqlalchemy/sql/naming.py')
-rw-r--r-- | lib/sqlalchemy/sql/naming.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/naming.py b/lib/sqlalchemy/sql/naming.py index b2cf1e9a5..ee99ccbce 100644 --- a/lib/sqlalchemy/sql/naming.py +++ b/lib/sqlalchemy/sql/naming.py @@ -54,12 +54,20 @@ class ConventionDict(object): def _key_referred_table_name(self): fk = self.const.elements[0] - reftable, refcol = fk.target_fullname.split(".") + refs = fk.target_fullname.split(".") + if len(refs) == 3: + refschema, reftable, refcol = refs + else: + reftable, refcol = refs return reftable def _key_referred_column_X_name(self, idx): fk = self.const.elements[idx] - reftable, refcol = fk.target_fullname.split(".") + refs = fk.target_fullname.split(".") + if len(refs) == 3: + refschema, reftable, refcol = refs + else: + reftable, refcol = refs return refcol def __getitem__(self, key): |