Hi all,
I’m having trouble this morning with submission of every form of a formset with a ManyToMany hidden_input widget. When rendered, there is a valid list of primary key ints in the field ‘value’.
<input type="hidden" name="n-18-6-state_space" value="[172, 175]" id="id_n-18-6-state_space">
When submitted, it fails validation and gives form.errors: "{‘state_space’: [‘Enter a list of values.’]}
This formset instantiation works for all the normal fields:
formset = NexusBRVMFormSet(request.POST, prefix="n-" + str(question.pk))
In the past, I’ve got the M2M content manually from request.POST.lists(), but my reading of the docs makes me think that shouldn’t be needed here(?)
I note in the docs that to save M2M data I should also call formset.save_m2m(), but my problem seems upstream from this.