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 @@
from string import zfill
request = context.REQUEST
from string import zfill
for k in kw.keys():
v = kw[k]
listbox = {}
if k == 'listbox_lines':
i = 1
for line in v:
#key = '_%s' % zfill(i,3)
key = '_%s' % line['listbox_key']
listbox[key] = line
i+=1
request.set('listbox',listbox)
if k == 'listbox':
listbox = {}
if v is not None:
i = 1
for line in v:
if line.has_key('listbox_key'):
key = '%s' % line['listbox_key']
else:
key = str(zfill(i,3))
listbox[key] = line
i+=1
request.set('listbox',listbox)
else:
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