using to_database for filter values
This commit is contained in:
@@ -493,7 +493,7 @@ class AbstractQuerySet(object):
|
|||||||
operator_class = BaseWhereOperator.get_operator(col_op or 'EQ')
|
operator_class = BaseWhereOperator.get_operator(col_op or 'EQ')
|
||||||
operator = operator_class()
|
operator = operator_class()
|
||||||
|
|
||||||
clone._where.append(WhereClause(col_name, operator, val))
|
clone._where.append(WhereClause(col_name, operator, column.to_database(val)))
|
||||||
|
|
||||||
return clone
|
return clone
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class TestDateTimeQueries(BaseCassEngTestCase):
|
|||||||
end = start + timedelta(days=3)
|
end = start + timedelta(days=3)
|
||||||
|
|
||||||
results = DateTimeQueryTestModel.filter(user=0, day__gte=start, day__lt=end)
|
results = DateTimeQueryTestModel.filter(user=0, day__gte=start, day__lt=end)
|
||||||
assert len(results) == 3
|
assert len(results) == 3
|
||||||
|
|
||||||
def test_datetime_precision(self):
|
def test_datetime_precision(self):
|
||||||
""" Tests that millisecond resolution is preserved when saving datetime objects """
|
""" Tests that millisecond resolution is preserved when saving datetime objects """
|
||||||
|
|||||||
Reference in New Issue
Block a user