From ecc8d139f67a32a6dc7860f3acc466421dbfbc7f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 6 Jul 2010 10:04:24 +0200 Subject: [PATCH] allow find for id --- pandora/backend/managers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora/backend/managers.py b/pandora/backend/managers.py index 215094d9b..a0cb6228e 100644 --- a/pandora/backend/managers.py +++ b/pandora/backend/managers.py @@ -66,6 +66,7 @@ class MovieManager(Manager): conditions = [] for condition in data['query']['conditions']: k = condition.get('key', 'all') + k = {'id': 'movieId'}.get(k, k) if not k: k = 'all' v = condition['value'] op = condition.get('operator', None) @@ -90,7 +91,8 @@ class MovieManager(Manager): k = '%s__iendswith' % k else: # elif op == '~': k = '%s__icontains' % k - k = 'find__%s' % k + if not k.startswith('movieId'): + k = 'find__%s' % k k = str(k) if exclude: conditions.append(~Q(**{k:v}))