diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-03-17 23:29:24 -0700 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-03-17 23:29:24 -0700 |
| commit | de9525a73e5166c1d624aba6580ad2316a0e87e0 (patch) | |
| tree | 8b0ebfba3c5a056e8ca9aa02f539c9bd7782a283 /lib/sqlalchemy/sql | |
| parent | 7138b4f9876d019ac600f57d6837791ea3db25a8 (diff) | |
| download | sqlalchemy-de9525a73e5166c1d624aba6580ad2316a0e87e0.tar.gz | |
no need to use getattr() here
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 6 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/expression.py | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 90e906727..766039332 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -787,14 +787,14 @@ class SQLCompiler(engine.Compiled): existing = self.binds[name] if existing is not bindparam: if (existing.unique or bindparam.unique) and \ - not existing.proxy_set.intersection(bindparam.proxy_set): + not existing.proxy_set.intersection( + bindparam.proxy_set): raise exc.CompileError( "Bind parameter '%s' conflicts with " "unique bind parameter of the same name" % bindparam.key ) - elif getattr(existing, '_is_crud', False) or \ - getattr(bindparam, '_is_crud', False): + elif existing._is_crud or bindparam._is_crud: raise exc.CompileError( "bindparam() name '%s' is reserved " "for automatic usage in the VALUES or SET " diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 7f6867e4a..5cef778bb 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -2873,6 +2873,8 @@ class BindParameter(ColumnElement): __visit_name__ = 'bindparam' quote = None + _is_crud = False + def __init__(self, key, value, type_=None, unique=False, callable_=None, isoutparam=False, required=False, |
