From 9a47ddcdad9466b2a30627177118a5f9f5cf43da Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 10 Jan 2012 01:56:16 +0530 Subject: [PATCH] just edit in, out, value --- pandora/annotation/views.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pandora/annotation/views.py b/pandora/annotation/views.py index e45141f6..dc8aa542 100644 --- a/pandora/annotation/views.py +++ b/pandora/annotation/views.py @@ -190,9 +190,12 @@ def editAnnotation(request): data = json.loads(request.POST['data']) a = get_object_or_404_json(models.Annotation, public_id=data['id']) if a.editable(request.user): - a.value = data['value'] - a.start = data['in'] - a.end = data['out'] + for key in ('value', 'in', 'out'): + if key in data: + setattr(a, { + 'in': 'start', + 'out': 'end' + }.get(key,key), data[key]) a.save() response['data'] = a.json() else: