forked from 0x2620/pandora
inbetween queries
This commit is contained in:
parent
9da8c75f70
commit
00c8f47541
2 changed files with 4 additions and 5 deletions
|
@ -72,7 +72,7 @@ def parseCondition(condition, user):
|
||||||
if exclude:
|
if exclude:
|
||||||
q = ~q
|
q = ~q
|
||||||
return q
|
return q
|
||||||
elif isinstance(v, list) and len(v) == 2:
|
elif isinstance(v, list) and len(v) == 2 and op == '=':
|
||||||
q = parseCondition({'key': k, 'value': v[0], 'operator': '>='}, user) \
|
q = parseCondition({'key': k, 'value': v[0], 'operator': '>='}, user) \
|
||||||
& parseCondition({'key': k, 'value': v[1], 'operator': '<'}, user)
|
& parseCondition({'key': k, 'value': v[1], 'operator': '<'}, user)
|
||||||
if exclude:
|
if exclude:
|
||||||
|
|
|
@ -34,12 +34,11 @@ def parseCondition(condition, user):
|
||||||
exclude = True
|
exclude = True
|
||||||
else:
|
else:
|
||||||
exclude = False
|
exclude = False
|
||||||
if op == '-':
|
if isinstance(v, list) and len(v) == 2 and op == '=':
|
||||||
q = parseCondition({'key': k, 'value': v[0], 'operator': '>='}, user) \
|
q = parseCondition({'key': k, 'value': v[0], 'operator': '>='}, user) \
|
||||||
& parseCondition({'key': k, 'value': v[1], 'operator': '<'}, user)
|
& parseCondition({'key': k, 'value': v[1], 'operator': '<'}, user)
|
||||||
if exclude:
|
if exclude:
|
||||||
return ~q
|
q = ~q
|
||||||
else:
|
|
||||||
return q
|
return q
|
||||||
if k == 'id':
|
if k == 'id':
|
||||||
v = decode_id(v)
|
v = decode_id(v)
|
||||||
|
|
Loading…
Reference in a new issue