Hi,
I'm using multiple formsets in Create / Update views, and I want to set some hidden fields in it : user_create, date_create on creation, user_update, date_update on update.
I've created a MultiFormsetMixin, which provide machinery to initialize those formsets in my CreateView / UpdateView.
Basicaly, the mixin fill a formset_list containing dicts with {'formset': <formset>, 'name': <prefix for formset>, 'verbose_name': <displayable name>}... The rendering of the formsets uses the same rendering than 'normal' formsets, via a {%for formset in formset_list %}{# formset rendering #}[% endfor %}. The formsets display normaly.
Data initialization is performed through the 'initial' dict. Every forms in the formsets have the same values for those fields, at initialization, so I update each form of the formsets with those values.
My problem is that those hidden fields are not rendered in the template, even in a 'hidden_field'. I've tryed to set 'exclude' and 'hidden_fields' Meta option in my ModelForm object, but it doesn't work.
When I go through the 'form.hidden_fields' I have my formset administrative normal data (id, parent) but not my fields.
Is it possible to render those fields in the template ?
Thanks !