From 28a577d69f2eb4824cc9a51054ff2e09c5ae176a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 26 Dec 2011 21:05:39 +0530 Subject: [PATCH] use annotation find value --- pandora/annotation/managers.py | 1 + pandora/clip/managers.py | 4 ++-- pandora/clip/views.py | 2 +- pandora/item/utils.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pandora/annotation/managers.py b/pandora/annotation/managers.py index bffd71ac..d156b803 100644 --- a/pandora/annotation/managers.py +++ b/pandora/annotation/managers.py @@ -26,6 +26,7 @@ def parseCondition(condition, user): 'in': 'start', 'out': 'end', 'id': 'public_id', + 'value': 'findvalue', }.get(k, k) if not k: k = 'name' diff --git a/pandora/clip/managers.py b/pandora/clip/managers.py index 4a748751..513036b0 100644 --- a/pandora/clip/managers.py +++ b/pandora/clip/managers.py @@ -27,7 +27,7 @@ def parseCondition(condition, user): 'in': 'start', 'out': 'end', 'place': 'annotations__places__id', - 'text': 'annotations__value', + 'text': 'annotations__findvalue', 'user': 'annotations__user__username', }.get(k, k) if not k: @@ -40,7 +40,7 @@ def parseCondition(condition, user): for l in filter(lambda l: not l.get('private', False), settings.CONFIG['layers'])] if k in public_layers: - return parseCondition({'key': 'annotations__value', + return parseCondition({'key': 'annotations__findvalue', 'value': v, 'operator': op}, user) \ & parseCondition({'key': 'annotations__layer', diff --git a/pandora/clip/views.py b/pandora/clip/views.py index 39f27d69..f6c2f04c 100644 --- a/pandora/clip/views.py +++ b/pandora/clip/views.py @@ -48,7 +48,7 @@ def order_query(qs, sort): if key.startswith('clip:'): key = e['key'][len('clip:'):] key = { - 'text': 'annotations__value', + 'text': 'annotations__sortvalue', 'position': 'start', }.get(key, key) elif key not in clip_keys: diff --git a/pandora/item/utils.py b/pandora/item/utils.py index c7c851b4..f72a1bbf 100644 --- a/pandora/item/utils.py +++ b/pandora/item/utils.py @@ -44,7 +44,7 @@ def sort_string(string): #pad numbered titles string = re.sub('(\d+)', lambda x: '%010d' % int(x.group(0)), string) - return unicodedata.normalize('NFKD', string).lower() + return unicodedata.normalize('NFKD', string) def sort_title(title):