diff --git a/pandora/item/managers.py b/pandora/item/managers.py index ce567021e..d7a90c2c8 100644 --- a/pandora/item/managers.py +++ b/pandora/item/managers.py @@ -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: diff --git a/pandora/place/managers.py b/pandora/place/managers.py index 34ce2c261..6acbc647e 100644 --- a/pandora/place/managers.py +++ b/pandora/place/managers.py @@ -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