MultiValueDict

0 views
Skip to first unread message

patrick k

unread,
Dec 28, 2005, 5:20:33 PM12/28/05
to django...@googlegroups.com
i´m having some trouble with a MultiValueDict and hope that somebody can
help me.

my request.POST looks like this:

{'body': ['some body text'], 'project': ['1'], 'note': ['1'], 'user':
['firs...@email.com', 'secon...@email.com', 'thir...@email.com'],
'byuser': ['1']}

now i´m trying to get all "users" to send them an email.
but with something like post_data["user"] i only get "thir...@email.com".

so, how can i get all the values for "user" within my dict?

patrick

James Bennett

unread,
Dec 28, 2005, 5:31:18 PM12/28/05
to django...@googlegroups.com
On 12/28/05, patrick k <pat...@vonautomatisch.at> wrote:
> now i´m trying to get all "users" to send them an email.
> but with something like post_data["user"] i only get "thir...@email.com".
>
> so, how can i get all the values for "user" within my dict?

You might want to take a look at Simon's response to this ticket:
http://code.djangoproject.com/ticket/1130


--
"May the forces of evil become confused on the way to your house."
-- George Carlin

patrick k

unread,
Dec 28, 2005, 5:39:56 PM12/28/05
to django...@googlegroups.com
thanks a lot.

Adrian Holovaty

unread,
Dec 28, 2005, 6:57:27 PM12/28/05
to django...@googlegroups.com
On 12/28/05, patrick k <pat...@vonautomatisch.at> wrote:
> {'body': ['some body text'], 'project': ['1'], 'note': ['1'], 'user':
> ['firs...@email.com', 'secon...@email.com', 'thir...@email.com'],
> 'byuser': ['1']}
>
> now i´m trying to get all "users" to send them an email.
> but with something like post_data["user"] i only get "thir...@email.com".
>
> so, how can i get all the values for "user" within my dict?

post_data.getlist('user') should do it. See the docs here:

http://www.djangoproject.com/documentation/request_response/#querydict-objects

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Reply all
Reply to author
Forward
0 new messages