]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
no need to use getattr() here
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 18 Mar 2013 06:29:24 +0000 (23:29 -0700)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 18 Mar 2013 06:29:24 +0000 (23:29 -0700)
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/expression.py

index 90e9067277eb9e44823953ba51e19dacadef1e08..76603933284408067e542dded2827836be20ed54 100644 (file)
@@ -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 "
index 7f6867e4a34a731e05b9d1973d0354df18da4ec4..5cef778bbb239f48f7007982f7eb1e3841202fcc 100644 (file)
@@ -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,