Commit 22c26d19 authored by Sebastien Robin's avatar Sebastien Robin

check if there is listbox_key


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@712 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 207b4ca5
...@@ -3,17 +3,22 @@ ...@@ -3,17 +3,22 @@
from string import zfill from string import zfill
request = context.REQUEST request = context.REQUEST
from string import zfill
for k in kw.keys(): for k in kw.keys():
v = kw[k] v = kw[k]
listbox = {} if k == 'listbox':
if k == 'listbox_lines': listbox = {}
i = 1 if v is not None:
for line in v: i = 1
#key = '_%s' % zfill(i,3) for line in v:
key = '_%s' % line['listbox_key'] if line.has_key('listbox_key'):
listbox[key] = line key = '%s' % line['listbox_key']
i+=1 else:
request.set('listbox',listbox) key = str(zfill(i,3))
listbox[key] = line
i+=1
request.set('listbox',listbox)
else: else:
request.set('my_%s' % k, v) request.set('my_%s' % k, v)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment