inbetween queries

This commit is contained in:
j 2012-04-02 17:33:23 +02:00
parent 9da8c75f70
commit 00c8f47541
2 changed files with 4 additions and 5 deletions

View file

@ -72,7 +72,7 @@ def parseCondition(condition, user):
if exclude:
q = ~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) \
& parseCondition({'key': k, 'value': v[1], 'operator': '<'}, user)
if exclude:

View file

@ -34,13 +34,12 @@ def parseCondition(condition, user):
exclude = True
else:
exclude = False
if op == '-':
if isinstance(v, list) and len(v) == 2 and op == '=':
q = parseCondition({'key': k, 'value': v[0], 'operator': '>='}, user) \
& parseCondition({'key': k, 'value': v[1], 'operator': '<'}, user)
if exclude:
return ~q
else:
return q
q = ~q
return q
if k == 'id':
v = decode_id(v)
if isinstance(v, bool): #featured and public flag