logo       

[solved] processing html arrays: msg#02305

DjangoUsers

Subject: [solved] processing html arrays


Salvatore Leone ha scritto:
> Hi,
>
> I've a form with a html array. How can I process this array in my view
> after the submit?
>
> I'm pretty sure the html code is correct because I can manage the array
> with a php script... so there must be a way to do it in python.
>
> -Salvatore
>
there is a poor documented django data type: MultiValueDict.
It' an extension of dicts for holding a list of values for the same key

multi_value_dict = request.FILES
for i in multi_value_dict.getlist('attacched_file[]'):
print i.name


the code is self explanatory:
http://code.djangoproject.com/browser/django/trunk/django/utils/datastructures.py

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
django-users+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise