diff options
author | jonathan vanasco <jonathan@2xlp.com> | 2015-04-02 13:30:26 -0400 |
---|---|---|
committer | jonathan vanasco <jonathan@2xlp.com> | 2015-04-02 13:30:26 -0400 |
commit | 6de3d490a2adb0fff43f98e15a53407b46668b61 (patch) | |
tree | d5e0e2077dfe7dc69ce30e9d0a8c89ceff78e3fe /lib/sqlalchemy/sql/naming.py | |
parent | efca4af93603faa7abfeacbab264cad85ee4105c (diff) | |
parent | 5e04995a82c00e801a99765cde7726f5e73e18c2 (diff) | |
download | sqlalchemy-6de3d490a2adb0fff43f98e15a53407b46668b61.tar.gz |
Merge branch 'master' of bitbucket.org:zzzeek/sqlalchemy
Diffstat (limited to 'lib/sqlalchemy/sql/naming.py')
-rw-r--r-- | lib/sqlalchemy/sql/naming.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/sqlalchemy/sql/naming.py b/lib/sqlalchemy/sql/naming.py index 9e57418b0..bc13835ed 100644 --- a/lib/sqlalchemy/sql/naming.py +++ b/lib/sqlalchemy/sql/naming.py @@ -1,5 +1,5 @@ # sqlalchemy/naming.py -# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors +# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under @@ -113,10 +113,12 @@ def _constraint_name_for_table(const, table): if isinstance(const.name, conv): return const.name - elif convention is not None and ( - const.name is None or not isinstance(const.name, conv) and - "constraint_name" in convention - ): + elif convention is not None and \ + not isinstance(const.name, conv) and \ + ( + const.name is None or + "constraint_name" in convention or + isinstance(const.name, _defer_name)): return conv( convention % ConventionDict(const, table, metadata.naming_convention) |