X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=rest%2Fcreate.py;h=e3b8e4db65b38f8b64385fd3ed997f25b1998785;hb=f9f854b970a22793c6fd2ede625f3891f05fd128;hp=e95a6e761352d115428ef5cae990e51e838fe9d1;hpb=c317373733197d7ba0b77017972f95289ea07b74;p=myslice.git diff --git a/rest/create.py b/rest/create.py index e95a6e76..e3b8e4db 100644 --- a/rest/create.py +++ b/rest/create.py @@ -23,13 +23,13 @@ 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(): + for el in list(req_items.items()): # Filters not used for create if el[0].startswith('filters'): o.filters[el[0][8:-1]] = el[1] elif el[0].startswith('params'): - o.params[el[0][7:-1]] = el[1] + #o.params[el[0][7:-1]] = el[1] + o.params.append({el[0][7:-1]:el[1]}) elif el[0].startswith('fields'): o.fields=req_items.getlist('fields[]') elif el[0].startswith('options'): @@ -43,6 +43,6 @@ def dispatch(request, object_type, object_name): else : return error('an error has occurred') - except Exception, e: + except Exception as e: return error(str(e))