MultiValueDict?

B

BarakatX2

<MultiValueDict: {u'rqFiles': [<InMemoryUploadedFile: log.png (image/
png)>, <InMemoryUploadedFile: add.png (image/png)>,
<InMemoryUploadedFile: del.png (image/png)>]}>

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.
Any help is appreciated.
 
J

John Machin

<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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,287
Messages
2,571,425
Members
48,117
Latest member
S.T.A.L.K.E.R

Latest Threads

Top