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
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:
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)