From f71240ac2cb90ba6bf73e8e1e90a2a4e3d161ff7 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 20 Jan 2017 17:44:31 +0100 Subject: [PATCH] look in the right place, fixes #2989 --- pandora/document/managers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora/document/managers.py b/pandora/document/managers.py index 21d119474..06ce3df52 100644 --- a/pandora/document/managers.py +++ b/pandora/document/managers.py @@ -142,7 +142,8 @@ def buildCondition(k, op, v, user, exclude=False, owner=None): k = str(k) value_key = str(value_key) if k == '*': - q = Q(**{value_key: v}) + q = Q(**{'find__value' + get_operator(op): v}) | \ + Q(**{'facets__value' + get_operator(op, 'istr'): v}) elif in_find: q = Q(**{'find__key': k, value_key: v}) else: @@ -257,6 +258,7 @@ class DocumentManager(Manager): user, item) if conditions: qs = qs.filter(conditions) + qs = qs.distinct() #anonymous can only see public items if not user or user.is_anonymous():