MultiValueDict?

John Machin sjmachin at lexicon.net
Fri Jun 26 19:52:21 EDT 2009


On Jun 27, 2:09 am, BarakatX2 <baraka... at gmail.com> wrote:
> <MultiValueDict: {u'rqFiles': [<InMemoryUploadedFile: log.png (image/
> png)>, <InMemoryUploadedFile: add.png (image/png)>,
> <InMemoryUploadedFile: del.png (image/png)>]}>

There is nothing in this schema to suggest that any object has a .name
attribute .

>
>     for f in files['rqFiles']:
>         print f.name
>
> This gives me an "'str' object has no attribute 'name'" error. I don't
> know if there is a special way to access MultiValueDicts values, but I
> assumed each key has a list that is accessed just like any other list.

You might start by telling us what a MultiValueDict is -- it's not
from the standard Python distribution AFAICT. Consider asking the
source of MultiValueDicts. Consider reading any docs for the module or
package that defines MultiValueDicts. Consider inspecting some of the
objects:

print files['rqFiles']
# given your error message, probably get sth like ['foo.png',
'bar.png', ...]
print files







More information about the Python-list mailing list