From dada4cbf4c522c574e33a0931bff0666c89fb133 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 17 Jan 2014 13:14:40 +0000 Subject: [PATCH] fix findDocuments by id --- pandora/document/managers.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/pandora/document/managers.py b/pandora/document/managers.py index 1b6e31ca..b72d8f61 100644 --- a/pandora/document/managers.py +++ b/pandora/document/managers.py @@ -2,6 +2,7 @@ # vi:si:et:sw=4:sts=4:ts=4 from django.db.models import Q, Manager +import ox from ox.django.query import QuerySet def parseCondition(condition, user, item=None): @@ -29,17 +30,8 @@ def parseCondition(condition, user, item=None): else: exclude = False if k == 'id': - try: - public_id = v.split(':') - username = public_id[0] - name = ":".join(public_id[1:]) - extension = name.split('.') - name = '.'.join(extension[:-1]) - extension = extension[-1].lower() - q = Q(user__username=username, name=name, extension=extension) - except: - q = Q(id__in=[]) - return q + v = ox.fromAZ(v) + return Q(**{k: v}) if isinstance(v, bool): #featured and public flag key = k else: