1👍
✅
If you call form’s save()
method several times the same model instance will be saved all the time. To create new instance at the each call you have to set the instance’s pk
to None
:
for item in unions_choice_list:
form.instance.pk = None
announcement = form.save(commit=False)
...
Or, which is the same:
for item in unions_choice_list:
announcement = form.save(commit=False)
announcement.pk = None
...
Source:stackexchange.com