1👍
✅
Field names should be strings:
# self.fields[queshion.id] = forms.CharField(label=queshion.text) # Change this
self.fields[str(queshion.id)] = forms.CharField(label=queshion.text) # to this
The keys in request.POST
are strings:
form = TestForm(data=request.POST, queshions=queshions)
Source:stackexchange.com