From 9ac5dc7ba9160045669065d35b8e59387effa6b9 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Thu, 5 Mar 2015 14:17:02 +0530 Subject: [PATCH] [PATCH] Fix find()'s docs on nested subconditions The documentation says that you need to write (P & Q) | R like this: { 'conditions': [ { 'query': { 'conditions': [P, Q], 'operator': '&' } }, R ], 'operator': '|' } but actually you need to omit the { 'query': ... } wrapping the subclause. Including it crashes parseCondition() at: v = condition['value'] for the obvious reason. --- pandora/item/views.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index d7451adc..a259eaff 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -112,10 +112,8 @@ def find(request, data): operator: string, // comparison operator, see below value: string // value }, { // ... and/or query objects (nested subconditions) - query: { - conditions: [object, ...], // list of condition objects - operator: string // logical operator, '&' or '|' - } + conditions: [object, ...], // list of condition objects + operator: string // logical operator, '&' or '|' }], operator: string // logical operator, '&' or '|' },