Rest update & delete working with ObjectRequest
authorLoic Baron <loic.baron@lip6.fr>
Mon, 3 Mar 2014 22:55:59 +0000 (23:55 +0100)
committerLoic Baron <loic.baron@lip6.fr>
Mon, 3 Mar 2014 22:55:59 +0000 (23:55 +0100)
rest/delete.py
rest/update.py

index 41a39e4..2548338 100644 (file)
@@ -7,11 +7,7 @@ from rest import ObjectRequest, error, success
 
 def dispatch(request, object_type, object_name):
     
-    o = objectRequest(request, object_type, object_name)    
-    
-    object_filters = {}
-    object_params = {}
-    result = {}
+    o = ObjectRequest(request, object_type, object_name)    
     
     if request.method == 'POST':
         req_items = request.POST
@@ -26,7 +22,7 @@ def dispatch(request, object_type, object_name):
             o.options = req_items.getlist('options[]')
 
     try:
-        response = o.execute()
+        response = o.delete()
 
         if response :
             return success('record deleted')
index e7b671a..119c468 100644 (file)
@@ -18,10 +18,6 @@ def dispatch(request, object_type, object_name):
     
     o = ObjectRequest(request, object_type, object_name)    
     
-    object_filters = {}
-    object_params = {}
-    result = {}
-    
     if request.method == 'POST':
         req_items = request.POST
     elif request.method == 'GET':