Vladimir Kirillov
unread,Sep 19, 2010, 7:29:52 AM9/19/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web.py
Hello, web.py!
Got a bug in web.input().
Case:
form contains is a select multiple field with name 'mselect', the POST
data looks like this (which is ok in web.data()):
mselect=1&mselect=2&mselect=3
web.input() filters out that data in storify() because defaults dict
does not have the key with expected list type.
utils.py, storify();
stor = Storage()
for key in requireds + tuple(mapping.keys()):
value = mapping[key]
if isinstance(value, list):
if isinstance(defaults.get(key), list): # <<< here
value = [getvalue(x) for x in value]
else:
value = value[-1]
This can be workarounded by supplying the expected key to the defaults
as list, i.e.:
web.input(mselect=[]).
Hope this gets fixed.
Thanks!
ps.
please cc: me