diff --git a/pandora/document/managers.py b/pandora/document/managers.py index fa0cd64ae..c3b19f089 100644 --- a/pandora/document/managers.py +++ b/pandora/document/managers.py @@ -132,6 +132,8 @@ def buildCondition(k, op, v, user, exclude=False, owner=None): q = Q(id__in=l.documents.all()) else: q = Q(id=0) + if exclude: + q = ~q return q elif key_config.get('fulltext'): qs = models.Document.find_fulltext_ids(v)