forked from 0x2620/pandora
just edit in, out, value
This commit is contained in:
parent
da70450f78
commit
9a47ddcdad
1 changed files with 6 additions and 3 deletions
|
@ -190,9 +190,12 @@ def editAnnotation(request):
|
||||||
data = json.loads(request.POST['data'])
|
data = json.loads(request.POST['data'])
|
||||||
a = get_object_or_404_json(models.Annotation, public_id=data['id'])
|
a = get_object_or_404_json(models.Annotation, public_id=data['id'])
|
||||||
if a.editable(request.user):
|
if a.editable(request.user):
|
||||||
a.value = data['value']
|
for key in ('value', 'in', 'out'):
|
||||||
a.start = data['in']
|
if key in data:
|
||||||
a.end = data['out']
|
setattr(a, {
|
||||||
|
'in': 'start',
|
||||||
|
'out': 'end'
|
||||||
|
}.get(key,key), data[key])
|
||||||
a.save()
|
a.save()
|
||||||
response['data'] = a.json()
|
response['data'] = a.json()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue