Hi Stefan, sorry i thought the process you are working is in POST request. Try to place your func() after formchoices3.
On Wed, Oct 25, 2023 at 4:10 PM Stefan Kusmierz <[email protected]> wrote: > Hi Migui, > I'm enchanted to receive such a quick answer. > 1. It's MyForm1_2_3_4() because it's the answer to the first Get request > while the page is opened > 2. Why would I try to save the form to the data base? > Best regards, Stefan > > > Migui Galan schrieb am Mittwoch, 25. Oktober 2023 um 03:39:16 UTC+2: > >> Hi Stefan! >> it should be form = MyForm1_2_3_4(request.POST) where POST request will >> place/process the data to your form then after form.save() >> >> On Wed, Oct 25, 2023 at 12:29 AM Stefan Kusmierz <[email protected]> >> wrote: >> >>> Dear community, >>> this looks like a django bug to me: >>> 1. (see first image) >>> By api query I confirm that the last object of class List has the value >>> "Startwert_neu2" in its field a, which was expected. >>> 2. (see second image) >>> The form "MyForm1_2_3_4" is instantiated using exactly the same command >>> ("List.objects.last().a") to build formchoices3 which enter the >>> corresponding choicefield furtherdown in "MyForm1_2_3_4" (not shown in the >>> image) >>> 3. While running the app my print out (to find the problem) states, that >>> formchoices3 does not contain the expected data "Startwert_neu2" but "mCP >>> purity", which is old data from older objects. So the rendered Form also >>> contains the old data. >>> To complete the information I also added snippets of views (fourth >>> image) and models (fifth image). >>> Is this a known issue? >>> Thanks in advance, >>> Stefan >>> >>> [image: DB-Query.jpg][image: Form.jpg][image: print out while >>> running.jpg][image: snippet from views.jpg][image: snippet from >>> models.jpg] >>> >>> -- >>> 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 [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/085fcd6d-13aa-422b-86f9-1e15c2549ac8n%40googlegroups.com >>> <https://groups.google.com/d/msgid/django-users/085fcd6d-13aa-422b-86f9-1e15c2549ac8n%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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/43b913ef-c9a3-4705-9b58-a889f2667426n%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/43b913ef-c9a3-4705-9b58-a889f2667426n%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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKKJMPOoEjOge6ct6qTvq6fNkZTDRJ4gAc-kvAtNzjN4Vu47XQ%40mail.gmail.com.

