You might want to loop through the list
Example:
Lists = request.getlist('item')
For list in Lists:
.........


On Sun, Jan 16, 2022, 9:30 PM Campbell McKilligan <campb...@dxclabs.com>
wrote:

> Hi,
>
> Using Django 3.2 and Py 3.9
>
> I have an ajax request which submits multiple values for a field to an
> UpdateView.
>
> In the request dict body I see both values (in this case, for the
> pool_list column):
>
> '_body':
> b"csrfmiddlewaretoken=z...h&...&key=...&expiry_datetime=&overflow=555&
> *pool_list=507&pool_list=499*&...
>
> Later in the request dict, I only see one of the values in the _post:
> '_post': ....* 'pool_list': ['499'],*
>
> This means that in request.POST.getlist('pool_list'), I'm only getting
> one result in the list object.
>
> Any idea why it's only the last value being populated in the getlist?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bf3a5e3b-4e8c-4a73-8647-d494bedbdf90n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/bf3a5e3b-4e8c-4a73-8647-d494bedbdf90n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B3Gu_NzgLrNW7PK-LVzCkE9U6BLctrrFDba88KfKFTwzi60%2Bg%40mail.gmail.com.

Reply via email to