]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
much more descriptive message for bind param name conflict, [ticket:1766]
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 Apr 2010 15:30:01 +0000 (11:30 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 Apr 2010 15:30:01 +0000 (11:30 -0400)
lib/sqlalchemy/sql/compiler.py

index 78c65771b75b9852a11e9796a4b0aea193b7d4b9..7a1821a70dd0162c4e1cc597ed595052fc2c32c0 100644 (file)
@@ -548,9 +548,12 @@ class SQLCompiler(engine.Compiled):
                         )
                 elif getattr(existing, '_is_crud', False):
                     raise exc.CompileError(
-                            "Bind parameter name '%s' is reserved "
-                            "for the VALUES or SET clause of this insert/update statement." 
-                            % bindparam.key
+                            "bindparam() name '%s' is reserved "
+                            "for automatic usage in the VALUES or SET clause of this "
+                            "insert/update statement.   Please use a " 
+                            "name other than column name when using bindparam() "
+                            "with insert() or update() (for example, 'b_%s')."
+                            % (bindparam.key, bindparam.key)
                         )
                     
         self.binds[bindparam.key] = self.binds[name] = bindparam
@@ -906,9 +909,12 @@ class SQLCompiler(engine.Compiled):
         bindparam._is_crud = True
         if col.key in self.binds:
             raise exc.CompileError(
-                    "Bind parameter name '%s' is reserved "
-                    "for the VALUES or SET clause of this insert/update statement." 
-                    % col.key
+                    "bindparam() name '%s' is reserved "
+                    "for automatic usage in the VALUES or SET clause of this "
+                    "insert/update statement.   Please use a " 
+                    "name other than column name when using bindparam() "
+                    "with insert() or update() (for example, 'b_%s')."
+                    % (col.key, col.key)
                 )
             
         self.binds[col.key] = bindparam