]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
base tests pass
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 9 Mar 2010 19:32:38 +0000 (14:32 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 9 Mar 2010 19:32:38 +0000 (14:32 -0500)
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/sql/expression.py
test/dialect/test_postgresql.py

index 56a03fc7cb733048bcfdeeecee026fe214f84f6e..e900b0cab1f03c51d78937a8de4c22fc23c721f7 100644 (file)
@@ -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
index e4a610e5df6d2af815a763a6f5282f988d96cc03..c559f3850bc0afa98f07bae398de8797f86bbe83 100644 (file)
@@ -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:
index b002e7f19fbbf9abf103641f25500d1f5432bc19..8358825c428fd347f97e84ce42612c2c60e8969e 100644 (file)
@@ -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)