From: Mike Bayer Date: Tue, 9 Mar 2010 19:32:38 +0000 (-0500) Subject: base tests pass X-Git-Tag: rel_0_6beta2~62^2~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9b059f782487ea375706dc32c5c79b8340df19a;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git base tests pass --- diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index 56a03fc7cb..e900b0cab1 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -134,7 +134,7 @@ class ColumnProperty(StrategizedProperty): def reverse_operate(self, op, other, **kwargs): col = self.__clause_element__() - return op(col._bind_param(other), col, **kwargs) + return op(col._bind_param(op, other), col, **kwargs) # TODO: legacy..do we need this ? (0.5) ColumnComparator = Comparator diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index e4a610e5df..c559f3850b 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -2167,7 +2167,7 @@ class _BindParamClause(ColumnElement): if _compared_to_type is not None: self.type = _compared_to_type._coerce_compared_value(_compared_to_operator, value) else: - self.type = sqltypes.NULLTYPE + self.type = sqltypes.type_map.get(type(value), sqltypes.NULLTYPE) elif isinstance(type_, type): self.type = type_() else: diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py index b002e7f19f..8358825c42 100644 --- a/test/dialect/test_postgresql.py +++ b/test/dialect/test_postgresql.py @@ -106,7 +106,7 @@ class CompileTest(TestBase, AssertsCompiledSQL): self.assert_compile(schema.CreateIndex(idx), "CREATE INDEX test_idx1 ON testtbl (data) WHERE data > 5 AND data < 10", dialect=postgresql.dialect()) - + def test_extract(self): t = table('t', column('col1', DateTime), column('col2', Date), column('col3', Time), column('col4', postgresql.INTERVAL)