From: Mike Bayer Date: Tue, 20 Dec 2005 05:27:13 +0000 (+0000) Subject: fix to parameter thing in insert X-Git-Tag: rel_0_1_0~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c62b09c5c795bb30f47cc6850bdfefa709d0a94;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix to parameter thing in insert added unicodetype to __all__ for types --- diff --git a/lib/sqlalchemy/ansisql.py b/lib/sqlalchemy/ansisql.py index 2cb5e5301b..795a2545b0 100644 --- a/lib/sqlalchemy/ansisql.py +++ b/lib/sqlalchemy/ansisql.py @@ -360,7 +360,7 @@ class ANSICompiler(sql.Compiled): self.visit_insert_sequence(c, seq) vis = DefaultVisitor() for c in insert_stmt.table.c: - if self.parameters.get(c.key, None) is None and c.default is not None: + if (self.parameters is None or self.parameters.get(c.key, None) is None) and c.default is not None: c.default.accept_visitor(vis) self.isinsert = True diff --git a/lib/sqlalchemy/engine.py b/lib/sqlalchemy/engine.py index 81d72b17b2..349bb4d1d6 100644 --- a/lib/sqlalchemy/engine.py +++ b/lib/sqlalchemy/engine.py @@ -381,7 +381,7 @@ class SQLEngine(schema.SchemaEngine): self.post_exec(proxy, compiled, parameters, **kwargs) return ResultProxy(cursor, self, typemap=compiled.typemap) - def execute(self, statement, parameters, connection=None, cursor=None, echo = None, typemap = None, commit=False, **kwargs): + def execute(self, statement, parameters, connection=None, cursor=None, echo=None, typemap=None, commit=False, **kwargs): """executes the given string-based SQL statement with the given parameters. The parameters can be a dictionary or a list, or a list of dictionaries or lists, depending diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py index a35e663b05..ee05136817 100644 --- a/lib/sqlalchemy/types.py +++ b/lib/sqlalchemy/types.py @@ -17,7 +17,7 @@ __all__ = [ 'TypeEngine', 'TypeDecorator', 'NullTypeEngine', 'INT', 'CHAR', 'VARCHAR', 'TEXT', 'FLOAT', 'DECIMAL', - 'TIMESTAMP', 'DATETIME', 'CLOB', 'BLOB', 'BOOLEAN', 'String', 'Integer', 'Numeric', 'Float', 'DateTime', 'Binary', 'Boolean', 'NULLTYPE' + 'TIMESTAMP', 'DATETIME', 'CLOB', 'BLOB', 'BOOLEAN', 'String', 'Integer', 'Numeric', 'Float', 'DateTime', 'Binary', 'Boolean', 'Unicode', 'NULLTYPE' ]