2010/9/19 Vladimir Kirillov <[email protected]>:
> 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.

That is the expected behavior. Try using web.raw_input() if you want
to avoid going through storify.

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to