git://git.onelab.eu
/
myslice.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e656f26
)
rest update
author
Ciro Scognamiglio
<ciro.scognamiglio@cslash.net>
Tue, 8 Apr 2014 17:51:31 +0000
(19:51 +0200)
committer
Ciro Scognamiglio
<ciro.scognamiglio@cslash.net>
Tue, 8 Apr 2014 17:51:31 +0000
(19:51 +0200)
rest/update.py
patch
|
blob
|
history
diff --git
a/rest/update.py
b/rest/update.py
index
cb11668
..
fb6bb97
100644
(file)
--- a/
rest/update.py
+++ b/
rest/update.py
@@
-31,17
+31,13
@@
def dispatch(request, object_type, object_name):
o.filters[el[0][8:-1]] = el[1]
elif el[0].startswith('params'):
print "#======> 0 ", el[0]
o.filters[el[0][8:-1]] = el[1]
elif el[0].startswith('params'):
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]})
+ print "#======> 1 ", req_items.getlist(el[0])
- #params[key][]
- if (el[0][-2:-1] == '[]') :
- o.params.append({el[0][7:-3]:",".join(
el[1]
)})
+ if (el[0][-2:] == '[]') :
+ # when receiving params[key][] = 'value1' ...
+ o.params.append({el[0][7:-3]:",".join(
req_items.getlist(el[0])
)})
else :
else :
- #
params[key]
+ #
when receiving params[key] = 'value'
o.params.append({el[0][7:-1]:el[1]})
print "o.params = ",o.params
o.params.append({el[0][7:-1]:el[1]})
print "o.params = ",o.params