ModelMultipleChoiceField - different number of values in request _body and _post

2022-01-16 Thread Campbell McKilligan
Hi, I have an ajax request which submits multiple values 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

request.POST.getlist('xxx') only has one value in ajax request for many2many

2022-01-16 Thread Campbell McKilligan
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=5

Re: ModelMultipleChoiceField - different number of values in request _body and _post

2022-01-17 Thread Campbell McKilligan
our post request is missing. Paste all the data that is > sent when making a post request. That way everyone gets the idea of what > you are trying to achieve. > > On Sun, Jan 16, 2022, 10:22 PM Campbell McKilligan > wrote: > >> Hi, >> I have an ajax request which s

Re: request.POST.getlist('xxx') only has one value in ajax request for many2many

2022-01-17 Thread Campbell McKilligan
t >> Example: >> Lists = request.getlist('item') >> For list in Lists: >> . >> >> >> On Sun, Jan 16, 2022, 9:30 PM Campbell McKilligan >> wrote: >> >>> Hi, >>> >>> Using Django 3.2 and Py 3.9 &

return json value as char/text instead of json

2021-06-30 Thread Campbell McKilligan
I'm using Concat of some annotated json fields (from .values("data__somefield", "data__someotherfield") The values are being returned as json, so the concatenation ends up with a hot mess of double quotes: "somevalue" "someothervalue" I can see in the query that Django is using the "->" operat