Tuesday, October 24, 2023

Form does not import current data from data base

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

DB-Query.jpgForm.jpgprint out while running.jpgsnippet from views.jpgsnippet 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 django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/085fcd6d-13aa-422b-86f9-1e15c2549ac8n%40googlegroups.com.

No comments:

Post a Comment