Dear community,
let me display the problem in a different way:
1. To answer the first Get request from the client the code instantiates class List and assigns a start value to the new object's field "a".
2. To answer a Post request from the client the code instantiates class List and assigns the first element of projekte_list_neto to the new object's field "a".
Either way - may it be Get or Post - the code then instantiates MyForm1_2_3_4 assigning the value of field "a" of the latest object
of class List from the database to the second element of the first tuple in formchoices3. Formchoices3 are the choices of the dropdownfield
"my_dropdown3" in MyForm1_2_3_4.
Although the api confirms, that the latest instance of class List contains the start value ("Startwert_neu2") in its field "a", Django grabs some
older data to instantiate MyForm1_2_3_4 and renders the form with these older data to answer the first Get request.
See models-, forms- and views-files below.
Best regards,
Stefan
Migui Galan schrieb am Mittwoch, 25. Oktober 2023 um 03:39:16 UTC+2: