Skip to content
Snippets Groups Projects
Verified Commit ee5a131c authored by Timm Fitschen's avatar Timm Fitschen
Browse files

date range

parent 399ca19f
Branches
No related tags found
No related merge requests found
......@@ -241,7 +241,11 @@ class BetweenOp(_BinaryOp):
def negate(self):
self.is_negated = True
def to_mongo(self):
if self._lower == self._upper:
return {"type": "pov", "p": self._field,
"o": " in ", "v": self._upper, "negation": self.is_negated}
if not self.is_negated:
return {
self._field: {
......@@ -483,7 +487,8 @@ class _StatementParser:
op = self._token2op(prev_op, tok, statement)
if not op:
continue
if isinstance(op, (_InNotInOp, LikeOp, IsOp, NotOp, CmpOp)) and prev_op is not None and isinstance(prev_op, IsTrueOp):
if isinstance(op, (_InNotInOp, LikeOp, IsOp, NotOp, CmpOp,
BetweenOp)) and prev_op is not None and isinstance(prev_op, IsTrueOp):
self._ops.remove(prev_op)
prev_op = prev_op.lhs
link_op()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment