Monday, January 17, 2022

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

Here's the parsed POST payload (I've trimmed all the HTML in the payload since it's repetitive).  Below is the non-parsed non-trimmed POST payload.
  1. csrfmiddlewaretoken:
    FmbcJ2t1RV6rMSf4TJzzPOe8Zm1yzXx7Jh3mdfSK1TTMEdBCKs5VIWhICBbbPNn6
  2. key:
    acme-seoul-2022-cast
  3. expiry_datetime:
  4. pool:
    519
  5. overflow_pool:
    520
  6. pool_list:
    507
  7. pool_list:
    497
  8. talent_engagement_status:
    1
  9. title:
    Seoul Environment Expo 2022 Cast Sign-Up
  10. thank_you_text:
    <h1>Congratulations!</h1>....

csrfmiddlewaretoken=FmbcJ2t1RV6rMSf4TJzzPOe8Zm1yzXx7Jh3mdfSK1TTMEdBCKs5VIWhICBbbPNn6&key=acme-seoul-2022-cast&expiry_datetime=&pool=519&overflow_pool=520&pool_list=507&pool_list=497&talent_engagement_status=1&title=Seoul+Environment+Expo+2022+Cast+Sign-Up&thank_you_text=%3Ch1%3ECongratulations!%3C%2Fh1%3E%0A%3Ch2%3EThank+you+for+signing+up%3C%2Fh2%3E%0A%3Cp%3EYou+will+shortly+receive+a+confirmation+email+with+details+of+your+registration+and+further+steps.%3C%2Fp%3E%0A%3Cp%3EPlease+share+this+sign-up+with+your+friends.%3C%2Fp%3E%0A%3Cp%3EWe+look+forward+to+meeting+you+very+soon.%3C%2Fp%3E%0A%3Cp%3EThank+you+for+registering+for+Seoul+Environment+Expo+2022%3C%2Fp%3E%0A%3Ch2%3EImportant+Dates%3C%2Fh2%3E%0A%3Cp%3EMonday%3C%2Fp%3E%0A%3Cp%3ETuesday%3C%2Fp%3E%0A%3Cp%3EWednesday...%3C%2Fp%3E%0A%0A%0A%0A%0A%3Ch2%3EFollow+Us!%3C%2Fh2%3E%0A%0A%0A++++%3Cp%3EFacebook%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Fwww.facebook.com%2Fdxclabs%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Facebook%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A++++%3Cp%3EInstagram%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Fwww.instagram.com%2Fdxclabs%2F%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Instagram%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A++++%3Cp%3ETwitter%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Ftwitter.com%2Fdxclabs%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Twitter%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ch2%3EMore+Information%3C%2Fh2%3E%0ACheck+out+our+FAQ+section+here%3A%0A%3Ca+href%3D%22https%3A%2F%2Fdxclabs.com%2Ffaqs%2F%22%3EShowoff!+FAQs%3C%2Fa%3E%0A%3Ch2%3ECan't+find+what+you're+looking+for%3F%3C%2Fh2%3E%0A%3Cp%3EGive+us+a+call+at%3A+555+2222%3C%2Fp%3E%0A%3Cp%3EEmail+us+at%3A+%3Ca+href%3D%22mailto%3Ahello%40dxclabs.com%22%3Ehello%40dxclabs.com%3C%2Fa%3E%3C%2Fp%3E&signup_text=%3Ch1%3EWelcome+to+Seoul+Environment+Expo+2022!%3C%2Fh1%3E%0A%3Cp%3EPlease+register+your+information+on+this+form.%3C%2Fp%3E%0A%3Cp%3EIf+you+have+any+questions+or+inquiries+feel+free+to+contact+us+at+%3Ca+href%3D%22mailto%3Ahello%40dxclabs.com%22%3Ehello%40dxclabs.com%3C%2Fa%3E.%0A%3C%2Fp%3E%0A%3Cp%3EMany+thanks!%3C%2Fp%3E%0A%3Cp%3EThe+Seoul+Environment+Expo+2022+Team%3C%2Fp%3E%0A%0A%0A%0A%0A%3Ch2%3EFollow+Us!%3C%2Fh2%3E%0A%0A%0A++++%3Cp%3EFacebook%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Fwww.facebook.com%2Fdxclabs%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Facebook%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A++++%3Cp%3EInstagram%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Fwww.instagram.com%2Fdxclabs%2F%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Instagram%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A++++%3Cp%3ETwitter%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Ftwitter.com%2Fdxclabs%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Twitter%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ch2%3EMore+Information%3C%2Fh2%3E%0ACheck+out+our+FAQ+section+here%3A%0A%3Ca+href%3D%22https%3A%2F%2Fdxclabs.com%2Ffaqs%2F%22%3EShowoff!+FAQs%3C%2Fa%3E%0A%3Ch2%3ECan't+find+what+you're+looking+for%3F%3C%2Fh2%3E%0A%3Cp%3EGive+us+a+call+at%3A+555+2222%3C%2Fp%3E%0A%3Cp%3EEmail+us+at%3A+%3Ca+href%3D%22mailto%3Ahello%40dxclabs.com%22%3Ehello%40dxclabs.com%3C%2Fa%3E%3C%2Fp%3E&expiry_text=%3Ch1%3ESign-up+for+Seoul+Environment+Expo+2022+is+now+closed.%3C%2Fh1%3E%0A%3Cp%3EWe+have+had+a+great+response+from+people+for+participation.%3C%2Fp%3E%0A%3Cp%3EUnfortunately%2C+registration+is+now+closed+and+you+won't+be+able+to+sign+up.%3C%2Fp%3E%0A%3Cp%3EWe're+really+sorry+to+disappoint+you.%3C%2Fp%3E%0A%3Ch2%3EOther+ways+to+be+involved%3A%3C%2Fh2%3E%0A%3Cp%3EBe+a+volunteer%3C%2Fp%3E%0A%3Cp%3ECome+and+watch%3C%2Fp%3E%0A%3Ch2%3EHow+can+we+watch%3F%3C%2Fh2%3E%0ATicket+sales+are+available+via+our+ticketing+partner%3A%0A%3Cb%3E%3Cu%3EEvent+Tix%3C%2Fu%3E%3C%2Fb%3E%0A%0A%0A%0A%0A%3Ch2%3EFollow+Us!%3C%2Fh2%3E%0A%0A%0A++++%3Cp%3EFacebook%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Fwww.facebook.com%2Fdxclabs%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Facebook%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A++++%3Cp%3EInstagram%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Fwww.instagram.com%2Fdxclabs%2F%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Instagram%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A++++%3Cp%3ETwitter%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Ftwitter.com%2Fdxclabs%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Twitter%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ch2%3EMore+Information%3C%2Fh2%3E%0ACheck+out+our+FAQ+section+here%3A%0A%3Ca+href%3D%22https%3A%2F%2Fdxclabs.com%2Ffaqs%2F%22%3EShowoff!+FAQs%3C%2Fa%3E%0A%3Ch2%3ECan't+find+what+you're+looking+for%3F%3C%2Fh2%3E%0A%3Cp%3EGive+us+a+call+at%3A+555+2222%3C%2Fp%3E%0A%3Cp%3EEmail+us+at%3A+%3Ca+href%3D%22mailto%3Ahello%40dxclabs.com%22%3Ehello%40dxclabs.com%3C%2Fa%3E%3C%2Fp%3E&overflow_text=%3Ch2%3ESign-up+for+Seoul+Environment+Expo+2022+is+full!%3C%2Fh2%3E%0A%3Cp%3EWe+have+had+a+great+response+from+people+for+participation!%3C%2Fp%3E%0A%3Cp%3EAs+we+are+full%2C+we've+put+you+in+a+wait+list.%3C%2Fp%3E%0A%3Cp%3EPlaces+do+become+available+now-and-then+and+we'll+let+you+know+as+soon+as+we+know+about+any+new+places.%3C%2Fp%3E%0A%3Ch2%3EOther+ways+to+be+involved%3A%3C%2Fh2%3E%0A%3Cp%3EBe+a+volunteer%3C%2Fp%3E%0A%3Cp%3ECome+and+watch%3C%2Fp%3E%0A%3Ch2%3EHow+can+we+watch%3F%3C%2Fh2%3E%0ATicket+sales+are+available+via+our+ticketing+partner%3A%0A%3Cb%3E%3Cu%3EEvent+Tix%3C%2Fu%3E%3C%2Fb%3E%0A%0A%0A%0A%0A%3Ch2%3EFollow+Us!%3C%2Fh2%3E%0A%0A%0A++++%3Cp%3EFacebook%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Fwww.facebook.com%2Fdxclabs%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Facebook%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A++++%3Cp%3EInstagram%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Fwww.instagram.com%2Fdxclabs%2F%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Instagram%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A++++%3Cp%3ETwitter%3A%0A++++++++%3Ca+href%3D%22https%3A%2F%2Ftwitter.com%2Fdxclabs%22+target%3D%22_blank%22+title%3D%22Seoul+Environment+Expo+2022+on+Twitter%22%3E%0A++++++++++++Seoul+Environment+Expo+2022%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fp%3E%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%3Ch2%3EMore+Information%3C%2Fh2%3E%0ACheck+out+our+FAQ+section+here%3A%0A%3Ca+href%3D%22https%3A%2F%2Fdxclabs.com%2Ffaqs%2F%22%3EShowoff!+FAQs%3C%2Fa%3E%0A%3Ch2%3ECan't+find+what+you're+looking+for%3F%3C%2Fh2%3E%0A%3Cp%3EGive+us+a+call+at%3A+555+2222%3C%2Fp%3E%0A%3Cp%3EEmail+us+at%3A+%3Ca+href%3D%22mailto%3Ahello%40dxclabs.com%22%3Ehello%40dxclabs.com%3C%2Fa%3E%3C%2Fp%3E
On Monday, 17 January 2022 at 05:22:01 UTC chau...@gmail.com wrote:
Information for your 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 <camp...@dxclabs.com> wrote:
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 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.



--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f2f7a4f2-26bd-46b3-88f2-532b5137124en%40googlegroups.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8142eebf-017a-47f1-ba2f-0fd41f87e1a4n%40googlegroups.com.

No comments:

Post a Comment