From: Ciro Scognamiglio Date: Tue, 8 Apr 2014 17:20:26 +0000 (+0200) Subject: fixed update when params is an array X-Git-Tag: myslice-1.1~151^2~4 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=a4f494123a2924f970d9702180949a1058534311 fixed update when params is an array --- diff --git a/rest/update.py b/rest/update.py index f81c63e8..cb116683 100644 --- a/rest/update.py +++ b/rest/update.py @@ -36,7 +36,14 @@ def dispatch(request, object_type, object_name): 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]}) + + #params[key][] + if (el[0][-2:-1] == '[]') : + o.params.append({el[0][7:-3]:",".join(el[1])}) + else : + #params[key] + o.params.append({el[0][7:-1]:el[1]}) + print "o.params = ",o.params elif el[0].startswith('fields'):