Rest: wip local:table, update, create = {'object':params}
[myslice.git] / rest / update.py
index b1a8875..f81c63e 100644 (file)
@@ -23,18 +23,21 @@ def dispatch(request, object_type, object_name):
     elif request.method == 'GET':
         #return error('only post request is supported')
         req_items = request.GET
+    print req_items
     for el in req_items.items():
         
-        print "#===============>",o.params
+        print "#===============>",el
         if el[0].startswith('filters'):
             o.filters[el[0][8:-1]] = el[1]
         elif el[0].startswith('params'):
-            print "#======>", el[0]
-            print "#======>", el[0][7:8]
-            print "#======>", el[0][10:-1]
-            print "#======>", el[1]
-            o.params.append({ el[0][10:-1] : el[1] })
-            
+            print "#======> 0 ", el[0]
+            #print "#======>", el[0][7:8]
+            #print "#======>", el[0][10:-1]
+            print "#======> 1 ", el[1]
+            #o.params = req_items.getlist('params[]')
+            #o.params.append({el[0]:el[1]})
+            o.params.append({el[0][7:-1]:el[1]})
+            print "o.params = ",o.params
             
         elif el[0].startswith('fields'):
             o.fields=req_items.getlist('fields[]')
@@ -50,5 +53,5 @@ def dispatch(request, object_type, object_name):
             return error('an error has occurred')
  
     except Exception, e:
-        return error(str(e))
+        return error("exception:"+str(e))