Update annotation put api format with title and description. (and remove useless import) new_rest_api
authorcavaliet
Fri, 26 Oct 2012 16:32:30 +0200
branchnew_rest_api
changeset 877 50d333d90541
parent 876 8fd46e270e23
child 878 4a5c54368447
Update annotation put api format with title and description. (and remove useless import)
src/ldt/ldt/api/ldt/resources/annotation.py
src/ldt/ldt/ldt_utils/segmentserializer.py
--- a/src/ldt/ldt/api/ldt/resources/annotation.py	Fri Oct 26 16:17:08 2012 +0200
+++ b/src/ldt/ldt/api/ldt/resources/annotation.py	Fri Oct 26 16:32:30 2012 +0200
@@ -18,7 +18,7 @@
     media = ""
     begin = ""
     end = "" 
-    content = {"data":""}
+    content = {"title":"", "description":""}
     tags = []
     meta = {"creator":"","created":""}
     
@@ -85,7 +85,8 @@
         meta = a['meta']
         author = meta['creator']
         date = meta['created']
-        type_id, new_id = adder.add(a['media'], a['type'], a['type_title'], a['content']['data'], '', a['tags'], begin, dur, author, date, None, "2194379", audio_src, audio_href)
+        #                       add(media,      cutting_id, cutting_title,  title,               text,                         tags_list,  begin, dur, author, date
+        type_id, new_id = adder.add(a['media'], a['type'], a['type_title'], a['content']['title'], a['content']['description'], a['tags'], begin, dur, author, date, None, "2194379", audio_src, audio_href)
         if not new_id:
             protect_models()
             raise BadRequest
--- a/src/ldt/ldt/ldt_utils/segmentserializer.py	Fri Oct 26 16:17:08 2012 +0200
+++ b/src/ldt/ldt/ldt_utils/segmentserializer.py	Fri Oct 26 16:32:30 2012 +0200
@@ -5,7 +5,6 @@
 from tagging.utils import parse_tag_input
 import lxml.etree
 import uuid
-import logging
 
 DATE_FORMATS = ["%d/%m/%Y", "%Y-%m-%d"]