From f436f88bf6867e36d497a954fbdb4fa5b62899ce Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 14 Jan 2011 14:45:01 +0000 Subject: [PATCH] empty condition --- pandora/item/managers.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pandora/item/managers.py b/pandora/item/managers.py index 216bee6b..187878ab 100644 --- a/pandora/item/managers.py +++ b/pandora/item/managers.py @@ -180,7 +180,7 @@ def parseConditions(conditions, operator): else: q = q & c return q - return None + return Q() class ItemManager(Manager): @@ -206,8 +206,7 @@ class ItemManager(Manager): data = lqs[0].query conditions = parseConditions(data['query']['conditions'], data['query'].get('operator', '&')) - if conditions: - qs = qs.filter(conditions) + qs = qs.filter(conditions) else: qs = qs.filter(id__in=lqs[0].items.all()) return qs @@ -240,8 +239,7 @@ class ItemManager(Manager): qs = qs.filter(available=True) conditions = parseConditions(data['query'].get('conditions', []), data['query'].get('operator', '&')) - if conditions: - qs = qs.filter(conditions) + qs = qs.filter(conditions) #FIXME: lists are part of query now # filter list, works for own or public lists